IN MAY 2012 a freshly elected François Hollande took off for Germany on his first foreign visit as president, determined to forge a close alliance with Angela Merkel. His plane was hit by lightning and had to turn back to Paris. Maybe it was an omen. Mr Hollande never achieved the reboot he had sought; a function of crises in both countries, poor chemistry between the two leaders and the growing gap between struggling France and the booming economy across the Rhine.

Paris sees Berlin as patronising and uncollegiate. Berlin sees Paris as dysfunctional and unreliable. The two have been through shocks—the refugee crisis in Germany and the terror attacks in France—that prompted “no strong bond of cooperation between the two countries, despite the potential to set an example to the rest of the EU”, write Josef Janning and Manuel Lafont Rapnouil of the European Council on Foreign Relations.

Yet the two are irredeemably interdependent. Berlin needs Paris to help keep the euro zone together, deal with the root causes of the refugee crisis in the Middle East and Africa (Mrs Merkel is increasingly taking an interest in the latter) and make Europe more self-sufficient in defence. There is even talk of Germany “buying into” France’s nuclear deterrent if Donald Trump backs away from NATO. Meanwhile Paris needs Germany to relax its stance on deficits, start consuming more and, ideally, move towards further euro zone integration.

Today France is at the polls and, for Berlin, the spread of possible winners ranges from the cataclysmic to the idyllic. It is no exaggeration to say that the result affects Germany’s place in Europe more than its own, less dramatic upcoming election, where as Thorsten Benner of the Berlin-based Global Public Policy Institute puts it: “80% of people will vote for shades of Emmanuel Macron” [that is, for mainstream, keenly pro-European parties]. So here, in ascending order of desirability in Berlin, is what France’s four main presidential candidates would mean for Germany.

The nightmare scenario: Marine Le Pen

It is hard to overstate how confident German officials are that the Eurosceptic, far-right Marine Le Pen will lose the election. That the liberal Mr Macron or the centre-right François Fillon will succeed Mr Hollande is, to them, not just a likelihood but a fact. There is no file sitting in a locked drawer somewhere in the Auswärtiges Amt with contingency plans for a Le Pen win. Which, however likely you deem that outcome, belies the disastrous effect that would have on Germany: economic turmoil, possible currency collapse, a new EU crisis, a weakened Russia policy, less power but more responsibility in Europe.

So if Mrs Le Pen reaches the second round today then wins it on May 7th, the initial reaction in Berlin will be speechlessness. But then Mrs Merkel and her ministers will have to react: “the euro can survive” insisted Wolfgang Schäuble in Washington earlier this week in a foretaste of the dogged commitments to the currency’s survival that will spill forth if Mrs Le Pen takes the Elysée. Then, officials say, they would listen carefully. The Front National candidate’s comments on France’s euro zone and EU membership have been inconsistent and unclear, though she has pledged to call a referendum on leaving the single currency. Berlin will want to hear how she plans to proceed before formulating a strategy.

That would prompt a debate in Mrs Merkel’s inner circle, which encompasses both foreign-policy idealists (who would lean towards isolating a President Le Pen) and foreign-policy realists (who might lean towards wooing her). The resulting “extreme crisis management”, as Mr Benner puts it, would have three planks. First, to engage with Mrs Le Pen, despite her emphatic hostility towards Germany (she has accused it of treating other countries like naughty children, claims Mrs Merkel has exposed Europe to Turkish blackmail and regularly attacks her refugee policies). Second, Germany would seek to build a ring of allies encircling Mrs Le Pen’s France; working particularly with the Benelux and Scandinavian countries, but also Italy and Spain, whose significance as German allies would grow. Third, in the long term it would quietly support the anti-Le Pen majority in the French legislature.

To emphasise: this would be damage limitation. A Le Pen win would be perhaps the biggest diplomatic crisis for Germany since reunification.

The other nightmare scenario: Jean-Luc Mélenchon

Most of the above applies if the far-left, anti-EU Jean-Luc Mélenchon wins, with a couple of differences. He is fractionally less hostile to the euro than Mrs Le Pen (probably earning him least-worst status in Berlin in the “apocalypse scenario” of a run-off between the two). But he may also be more temperamentally anti-German. His 2015 book, “Bismarck’s Herring”, attacked French reformists “hypnotised” by the “German poison” and compared them to World War Two collaborators. He has also referred to the reunification of East and West Germany as an “annexation”. Safe to say, Mr Mélenchon would not make an easy partner.

Imperfect but workable: François Fillon

A win for Mr Fillon over either Mrs Le Pen or Mr Mélenchon would elicit relief in Berlin. Indeed, from his selection as centre-right candidate in November to the explosion in February of Penelopegate, the corruption scandal that has since weighed him down, he looked like the frontrunner. So Berlin is used to the idea of him as president. Officials here welcome his economic reformism. He belongs to the EPP, the same European political family as Mrs Merkel. The two have known each other for years. Those around him (especially Bruno Le Maire, once a likely Fillon foreign minister who quit over the scandal) have insisted to German officials that he has learned from Mr Hollande’s failure to forge a tight link with Berlin early in his premiership and will not make the same mistake.

That said, if the run-off pits Mr Fillon against Mr Macron, most top German figures (with a few exceptions on the right of the CDU and FDP, and in the AfD) will be rooting for Mr Macron. In several important respects, Mr Fillon is far from ideal for Germany.

For one thing Penelopegate will loom over him, weakening his presidency. Mrs Le Pen and Mr Mélenchon may not believe it, but Germany has no appetite for hegemony: “a European Germany, not a German Europe” as Thomas Mann put it. Hegemony means one of two things to Berlin: an unassertive Germany held responsible for everything that goes wrong or an assertive Germany hated for telling others what to do. So the spectre of a Fillon presidency crippled by corruption allegations, and thus a weak France, does not appeal to German leaders.

Moreover, Mr Fillon wants to end sanctions on Russia, Mrs Merkel wants to keep them. He wants upper limits on refugee numbers, she does not. They may inhabit the same political family, but Mrs Merkel is well to his left and Mr Fillon is said to see her as a bit of a pinko. To some in her orbit, he seems more oriented towards Britain (with his admiration for Margaret Thatcher and his Welsh wife) than towards Germany.

The dream outcome: Emmanuel Macron

If mainstream political Berlin had a dream outcome, it would be a President Macron with a workable majority (of various parties, realistically) following the French legislative elections in June. Like Mr Fillon, he wants to reform France’s economy, to German approval. Unlike Mr Fillon, he is not dogged by corruption scandals, has praised Mrs Merkel’s refugee policy and agrees with her on Russia. He wants a “new deal” with Berlin parlaying French security assets and a credible plan for economic reform into a new German approach to deficits and burden-sharing within the euro zone, buying his government space for said reform.

Mr Macron’s contacts with the German establishment are impeccable. He has visited Berlin twice this year, unlike any of his rivals. “It was well briefed, he knows Germany very well” says one senior figure of his speech in January. An event in March with Sigmar Gabriel, the foreign minister and an old friend, and the philosopher Jürgen Habermas was less a debate than a love-in. The Jacques Delors Institute, the think-tank that helped organise it, is a particularly influential channel between Mr Macron and Mr Gabriel’s SPD. It will become an important Franco-German lynchpin if he becomes president. But much of the CDU has is similarly keen. Mr Schäuble has endorsed Mr Macron. Mrs Merkel cannot go that far, but granted him an audience on his March visit, despite furious entreaties from Mr Fillon. Restrained by diplomatic protocol from holding a press conference with him, she left the curtains of the room where they met open and thus allowed photographers to snap the encounter and record her approval.

The two do not agree on everything. Mr Macron wants a euro zone budget, parliament and finance minister; which are unpopular here and have already set the hawkish Finance Ministry in Berlin against him. He has (rightly) called Germany’s vast trade surplus unsustainable—albeit in the context of an election in which he needed to rebut accusations of slavishness towards Mrs Merkel. His talk of a grand new deal unsettles some German officials, who tend prefer muddling through.

But that is not to say that the new deal he described on his March visit it totally unrealistic. Focusing on investment, borders and defence, it balances things France needs with things Germany needs. This approach enjoys some support in Berlin, particularly in the foreign office. In Mr Gabriel—who in his new job is trying to reset German attitudes about Europe and build a less ordoliberal foreign policy—and Martin Schulz, the SPD chancellor candidate, he has fellow travellers. And in Mr Macron, the likes of Mr Gabriel have a savvy ally in Paris who gets that to buy fiscal breathing room, France must appear credible to Germany. Hence the presidential candidate’s visits, his talk of “winning Germans’ trust”, his determination to show Berlin that Paris is capable of real discipline under his leadership.

So one big quandary confronts Germany if Mr Macron wins and obtains a workable legislative majority: how far to go in any such “new deal”? It is a problem that Berlin would love to have.