A Ukrainian serviceman fires a grenade launcher this month in the government-held town of Avdiyivvka, Ukraine. (Oleksandr Klymenko/Reuters)

Josh Cohen is a former U.S. Agency for International Development project officer involved in managing economic reform projects in the former Soviet Union.

As the Trump administration struggles to find its footing, fighting between Ukrainian troops and Russian proxies has once again flared up in eastern Ukraine. More than 10,000 people have been killed in the conflict, and the region’s infrastructure now lies in ruins. Both Russia and Ukraine remain bound by the February 2015 Minsk II accord, a package of measures ostensibly aimed at paving the way for peace. Yet two years after it was signed, the agreement has failed to bring an end to the war.

While critics have assailed Minsk II for not clearly addressing Ukraine’s sovereignty over its occupied territories, the agreement still contains a number of useful provisions related to ending the conflict and returning Ukraine’s border to Kiev’s control. What Minsk II does not tackle, though, is the broader issue of Kiev’s basic geopolitical orientation. Ending the conflict once and for all therefore requires a deal explicitly addressing this issue, and above all how Russia, Ukraine and the West interact with one another. What Ukraine requires more than anything else is breathing space to implement the desperately needed economic and political reforms to consolidate its young democracy and make a full break with its past — even if this involves some difficult compromises. Here’s what a realistic agreement might look like.

First and foremost, any possibility of Ukraine joining the North Atlantic Treaty Organization should be taken off the table. Although NATO offered Ukraine an offer of future membership at a summit in 2008, the reality is that many NATO countries would not support Ukraine’s membership in NATO anyway, and indeed the alliance already denied Ukraine a track toward membership once before. It is not hard to see why. As a 2016 report from the Rand Corporation concluded, Russia could overrun the Baltics in three days, and given the overwhelming military force that Russia can bring to bear in its back yard, it is hard to imagine anything other than a similar outcome in Ukraine. Factor in Russia’s status as the world’s largest nuclear power, and it is nearly impossible to imagine the United States committing itself by treaty to defend Ukraine militarily. (The Europeans, needless to say, would be even more reluctant.)

Furthermore, NATO membership remains divisive even within Ukraine. A Gallup poll released last month discovered that Ukrainians have soured on NATO since 2014, with a plurality now viewing NATO as a threat rather than as protection. Moreover, a Ukrainian polling organization, the Kiev International Institute of Sociology, discovered that strong majorities in both the south and east of Ukraine would vote against NATO membership in a referendum — meaning that Kiev’s pursuit of this goal could undermine the substantial progress Ukraine has made to overcome its previous geographic divisions.

Therefore, although many might criticize taking Kiev’s agreement to forgo NATO membership as appeasement, from a Ukrainian perspective it would constitute a welcome expression of realpolitik. Russian President Vladimir Putin has repeatedly stated that Russia’s annexation of Crimea was done partly to forestall the possibility of Ukraine joining NATO, and many in the West have long underestimated the sense of humiliation and fear engendered by NATO’s repeated expansion into the former Soviet bloc. And given that Ukraine’s accession to NATO remains so unrealistic anyway, forgoing NATO membership costs Ukraine little while potentially strengthening its hand on other issues much more fundamental to its future.

This leads to the second key issue in any possible deal to end Ukraine’s grinding conflict: Kiev’s relationship with the European Union. Compared with 2013, when the country was deeply split over the issue, most Ukrainians now favor eventual E.U. membership, and the country has already signed an Association Agreement with the E.U. Therefore, in exchange for Kiev agreeing not to pursue NATO membership, Russia must reciprocate by explicitly acknowledging Ukraine’s right to pursue both membership in the E.U. as well as any non-military political or economic relationship with Brussels it may choose instead.

This will likely be a tough pill for Russia to swallow. The Kremlin wants Ukraine to join the Eurasian Economic Union, a Russian-dominated free-trade bloc aimed at the former Soviet republics on Moscow’s borders. Absent dramatic shifts in Ukrainian politics, however, this is not going to happen. So while Ukraine needs to accept reality regarding NATO, it is time for Russia to accept that, like it or not, Ukraine remains determined to pivot toward Europe politically and economically.

Luckily for Russia, however, E.U. membership is nowhere on the horizon for Ukraine. While Ukraine’s optimistic leaders moot a five- or 10-year path to membership for Ukraine, European Commission President Jean-Claude Juncker has ruled this out for at least another 20 to 25 years. From this perspective, Russia gives up little by agreeing that Ukraine has the right to join the E.U. And down the road — perhaps after Putin passes from the scene — Russia and Ukraine may well choose to rebuild their relationship.

The third major issue that should be addressed in any deal is Ukraine’s political structure. Moscow consistently pushes the idea of “federalizing” Ukraine, which it defines as providing wide power to Ukraine’s regions, including the ability to forge independent economic or political relationships with other countries. In practice this would enable Russia to exert vast influence in eastern Ukraine. Needless to say, this will never be acceptable to Kiev.

What does make sense, though, is for Ukraine to decentralize some of its powers to the regions — something even President Petro Poroshenko supports. For example, regions should receive greater control over tax and spending, as well as the ability to directly elect their own governors. It also makes sense to allocate control over many social issues such as education, language and culture to Ukraine’s regions. Numerous European countries follow some form of this model. For example, France elects regional presidents, while in Wales, a division of the United Kingdom, both English and Welsh are official local languages. In Germany, responsibility for education lies primarily with the states.

From Moscow’s perspective, a moderate amount of devolution allows Putin to assert that he has successfully “protected” the rights of Ukraine’s ethnic Russian or Russian-oriented citizens, most of whom live in the south or east. From Kiev’s point of view, meanwhile, divisive issues such as the status of the Russian language or the politics of memory get decided at the local level where they belong, thereby allowing a common civic identity to develop around Ukraine’s rich multicultural makeup.

Once these various geopolitical issues are resolved, it will be time to address the Russian-Ukrainian economic relationship. Moscow and Ukraine are locked in a tit-for-tat trade war, something that benefits neither side. Ultimately, there is no reason that Ukraine cannot have free-trade agreements with both the E.U. and Russia if both sides agreed. While some technical barriers to a Russian-Ukrainian free-trade agreement exist — primarily Moscow’s concern that Ukraine might constitute a backdoor to Russia for E.U. firms that might otherwise be subject to Russian tariffs — these issues should be resolvable.

Last but not least comes Crimea — perhaps the issue least subject to compromise. Moscow invaded and annexed the Black Sea peninsula from Ukraine in March 2014 and states that it considers Crimea part of Russia and will not return it to Ukraine. Ukrainian officials likewise reject any land for peace trade-offs regarding Crimea. For this reason, it will likely prove necessary to simply defer Crimea negotiations until some later date. While an inelegant fudge, this will probably do for the moment. Down the road, if genuine reconciliation ever occurs, some formula for shared sovereignty and perhaps some form of Russian payment to Ukraine for the peninsula might be possible.

To be clear, there are many reasons that a Russia-Ukraine deal built upon these parameters won’t happen. For one thing, Putin may be willing to settle for nothing less than a pliant Ukraine pulled fully back into Russia’s orbit — in line with his neo-imperial comment to former president George W. Bush that “Ukraine is not even a state.” Likewise, after three years of war, the appetite from the Ukrainian side for any deal that smacks of compromise or concessions could surely face pushback, particularly from nationalist hard-line groups. To overcome each side’s resistance, the West should offer carrots to both. Russia could be persuaded by an end to the economic sanctions currently in place, while Ukraine should be offered a multibillion-dollar “mini-Marshall Plan” to rebuild the Donbas.

It also needs to be acknowledged that expecting Ukraine to make any compromises — or even to negotiate with Russia — is unjust. After all, Russia illegally annexed Crimea and clearly remains the prime instigator of violence in the Donbas. In an ideal world, Moscow would return Crimea, end all support for its separatist proxies and volunteer to pay Kiev reparations for its actions — all without receiving anything in return. Of course, it would also be wonderful if Putin bought everyone in the world a cappuccino and a puppy. But none of these things are likely to happen, and Kiev will ultimately need to choose between endless conflict or an imperfect but realistic settlement that allows it to finish the job of building a modern democratic and European state.

As Otto von Bismarck once said, “politics is the art of the possible, the attainable … the art of the next best.” If both Moscow and Kiev keep Bismarck’s aphorism in mind, a Russia-Ukraine deal may well be possible after all.