To reorient Argentina’s diplomacy, Mr Macri has named Susana Malcorra, a little-known UN official, as foreign minister. The new president wants to repair relations with the United States and European countries, which Ms Fernández snubbed in favour of friendship with authoritarian regimes such as those of Russia, Iran and China. Mercosur, a six-nation trade grouping including Brazil, is likely to be more open to agreements with other trade partners than it has been under the Kirchners. Mr Macri will be a bolder advocate of democracy in South America than his fellow leaders are: he has already said that Venezuela should be suspended from Mercosur if it fails to conduct fair parliamentary elections on December 6th and to release opposition leaders from jail.

His most urgent task is to fix the economy. Ms Fernández kept it limping along by means of “patches”, quick fixes such as a currency swap with China to replenish foreign-exchange reserves. These have been depleted by debt payments and by spending to support an overvalued exchange rate, which gives Argentines an illusion of prosperity but throttles exports. Liquid reserves are probably much lower than the $26 billion the government reports. Last week an oil tanker was left tossing for days off Bahia Blanca because the government could not pay for the cargo. “It’s extraordinary that the economy is on the verge of crisis and people don’t feel it,” says Miguel Kiguel, an economist.

Mr Macri faces three big and interlinked tasks: removing economic distortions, balancing fiscal accounts and restoring normal financial relations with the outside world. The immediate priorities are to boost the Central Bank’s reserves, unify the exchange rate and lift exchange controls. An adviser to the new president says that lifting exchange controls and removing export taxes will encourage farmers to sell crops they have hoarded; this could bring in up to $9 billion to the Central Bank, says Luis Miguel Etchevehere of the Rural Society, a farmers’ lobby. Rather than turn to the IMF for support, a political non-starter, the new team will look for other emergency sources of foreign funds. They are expected to try to end Argentina’s isolation from international credit markets by seeking an agreement with bondholders who pushed the country into default last year.

“The challenge is getting the sequencing right,” the adviser admits. Devaluing and freeing the peso without reserves risks an inflationary plunge in its value. But the key to raising reserves is a more realistic exchange rate. In victory Mr Macri was more cautious than as a candidate. Exchange controls will be lifted “once the situation is normalised”, he said.

Raising funds abroad would also give the new government more time to close the fiscal deficit. It will be lumbered with a swollen bureaucracy and indexed spending on benefits which will take time to reform. It can move more quickly to cut energy and transport subsidies which go to rich and poor alike: on average, Argentines pay just $9 a month for electricity. But Argentina has never managed to cut its fiscal deficit by more than one percentage point of GDP per year, notes Luis Secco of Perspectiv@s, a consultancy.

All this will inflict pain in the short-term. Barclays, a bank, expects an economic contraction next year (of 1.1%) before a rebound in 2017. “The big danger is social unrest,” says Mr Kiguel. Mr Macri’s narrow victory means that he will have to build a mandate for radical change. “The first package will have to be more centre-left than centre-right,” says the adviser, acknowledging the political constraints. The Peronists control the Senate; they must be persuaded to repeal laws that prevent a deal with the holdouts.

But the new president has some high cards to play. The Peronist governors, who have influence in the Senate, are a pragmatic bunch; many of them need support from the central government to restructure their debts. Argentina’s isolation from the capital markets means that it is barely indebted. If Mr Macri restores confidence by governing in a transparent and predictable manner, money could emerge from mattresses and flow back home from foreign bank accounts.

He knows it will not be easy. The peroration to his post-election speech at a convention centre on the River Plate was a plea, not a victory cry. “I’m here because you got me here,” he told his cheering supporters. “So I ask you: please don’t abandon me.”