AT THE start of 2016 Brazil should be in an exuberant mood. Rio de Janeiro is to host South America’s first Olympic games in August, giving Brazilians a chance to embark on what they do best: throwing a really spectacular party. Instead, Brazil faces political and economic disaster.

On December 16th Fitch became the second of the three big credit-rating agencies to downgrade Brazil’s debt to junk status. Days later Joaquim Levy, the finance minister appointed by the president, Dilma Rousseff, to stabilise the public finances, quit in despair after less than a year in the job. Brazil’s economy is predicted to shrink by 2.5-3% in 2016, not much less than it did in 2015. Even oil-rich, sanction-racked Russia stands to do better. At the same time, Brazil’s governing coalition has been discredited by a gargantuan bribery scandal surrounding Petrobras, a state-controlled oil company. And Ms Rousseff, accused of hiding the size of the budget deficit, faces impeachment proceedings in Congress.

As the B in BRICS, Brazil is supposed to be in the vanguard of fast-growing emerging economies. Instead it faces political dysfunction and perhaps a return to rampant inflation. Only hard choices can put Brazil back on course. Just now, Ms Rousseff does not seem to have the stomach for them.

Dismal Dilma

Brazil’s suffering, like that of other emerging economies, stems partly from the fall in global commodity prices. But Ms Rousseff and her left-wing Workers’ Party (PT) have made a bad situation much worse. During her first term, in 2011-14, she spent extravagantly and unwisely on higher pensions and unproductive tax breaks for favoured industries. The fiscal deficit swelled from 2% of GDP in 2010 to 10% in 2015.

Brazil’s crisis managers do not have the luxury of waiting for better times to begin reform (see article). At 70% of GDP, public debt is worryingly large for a middle-income country and rising fast. Because of high interest rates, the cost of servicing it is a crushing 7% of GDP. The Central Bank cannot easily use monetary policy to fight inflation, currently 10.5%, as higher rates risk destabilising the public finances even more by adding to the interest bill. Brazil therefore has little choice but to raise taxes and cut spending.

Mr Levy made a game attempt to renovate the building while putting out the fire. He trimmed discretionary spending by a record 70 billion reais ($18 billion) in 2015 and tightened eligibility for unemployment insurance. But it was not enough. The recession dragged down tax revenues. Ms Rousseff gave her finance minister only lukewarm support and the PT was hostile towards him. The opposition, intent on ousting the president, was in no mood to co-operate.

Although he was a senior treasury official during Ms Rousseff’s disastrous first term, Nelson Barbosa may be able to accomplish more as finance minister. He has political support within the PT. He also has bargaining power, because Ms Rousseff cannot afford to lose another finance minister. One early test will be whether Mr Barbosa persuades a recalcitrant Congress to reinstate an unpopular financial-transactions tax.

A central target should be pensions. The minimum benefit is the same as the minimum wage, which has risen by nearly 90% in real terms over the past decade. Women typically retire when they are 50 and men stop work at 55, nearly a decade earlier than the average in the OECD (a club of mostly rich countries). Brazil’s government pays almost 12% of GDP to pensioners, a bigger share than older, richer Japan.

If Brazil is to fulfil its promise, much, much more is needed. A typical manufacturing firm spends 2,600 hours a year complying with the country’s ungainly tax code; the Latin American average is 356. Labour laws modelled on those of Mussolini make it expensive for firms to fire even incompetent employees. Brazil has shielded its firms from international competition. That is one reason why, among 41 countries whose performance was measured by the OECD, its manufacturing productivity is the fourth-lowest.

To reform work and pensions, Ms Rousseff must face up to problems that have been decades in the making. Some 90% of public spending is protected from cuts, partly by the constitution which, in 1988, celebrated the end of military rule by enshrining generous job protection and state benefits. Because it is so hard to reform, Brazil’s public sector rivals European welfare states for size but emerging ones for inefficiency. Long a drain on economic vitality, Brazil’s overbearing state is now a chief cause of the fiscal crisis.

Waxing and waning: Brazil's economic woes, in charts Overcoming such deep-rooted practices would be hard for any government. In Brazil it is made all the harder by a daft political system, which favours party fragmentation and vote-buying and attracts political mercenaries who have little commitment either to party or to programme. The threshold for a party to enter the lower house of Congress is low; today 28 are represented, adding to the legislative gridlock. Congressmen represent entire states, some as populous as neighbouring Latin American countries, which makes campaigning ruinously expensive—one reason why politicians skimmed off huge amounts of money from Petrobras. It is therefore hard, despite Mr Barbosa’s advantages, to feel optimistic about the prospects for deep reform. Voters hold politicians in contempt. The opposition is bent on impeaching Ms Rousseff, a misguided battle that could dominate the political agenda for months. The PT has no appetite for austerity. Achieving the three-fifths support in both houses of Congress needed for constitutional reforms will be a tall order.

Reckless Rousseff

And if Ms Rousseff fails to bring about change? Most of Brazil’s borrowing is in local currency, which makes default unlikely. Instead, the country may end up inflating away its debts. Brazil’s achievement has been to lift tens of millions of people out of rag-and-flip-flop poverty. Recession will halt that, or even begin to reverse it. The hope is that Brazil, which has achieved hard-won economic and democratic stability, does not lapse once again into chronic mismanagement and turmoil.