BY 9.00am on September 6th a crowd has appeared outside Fábio Gaia’s one-storey house in Murici, a town surrounded by sugar-cane fields. The councilman attends to a stream of constituents who proffer crumpled bits of paper: prescriptions, receipts for ultrasound scans and electricity bills. It is a month before Brazil’s general election, so he promises to pay them all. “We go door to door with our electoral programme, but people ask what we have to give,” says Mr Gaia, who is campaigning for candidates from the conservative Progressive Party (PP). “If we don’t, the other guys will.”

The other guys are the Calheiros clan, ranchers from Murici who have dominated politics in Alagoas, a poor state in north-eastern Brazil, for more than three decades. Their chief, Renan Calheiros, is a three-time senator who belongs to the country’s largest party, the Brazilian Democratic Movement (MDB). His son is the governor, his brother is a state legislator, his nephew is Murici’s mayor and his sister-in-law runs the town’s social-assistance centre. In the weeks before the elections, whose first round takes place on October 7th, the centre is distributing sacks of food.

This is how politics works in much of Brazil. The money that flows into party coffers flows out in the form of handouts or vote-buying. The going rate in Alagoas is said to be 100 reais ($25). While vote-buying is rarer in richer places, Alagoas’s cash-fed web of political alliances has equivalents in other parts of the country.

No dynasty has played the game better than the Calheiroses. In the previous national election, in 2014, the MDB in Alagoas was the party’s fourth-biggest fund-raiser, even though, by population, the state ranks 17th. This helped Mr Calheiros to become justice minister and president of the senate under three administrations. To fight the forthcoming election the family has assembled a coalition of 19 parties, the biggest state-level alliance.

Nearly all of Alagoas’s 102 mayors back the Calheiros clan. They count on the family to extract money from the federal government for roads, hospitals and other projects, which will help them win re-election when their turn comes (in 2020 for municipal offices). “Renan has perfect domination on a local level,” says Geraldo de Majella, a historian of Alagoas.

Despite the largesse, Murici remains poor. Just a tenth of its residents have formal jobs; the mayor’s office is the biggest employer. The sugar-cane plantations provide seasonal work. More than half the town’s inhabitants get welfare benefits from the federal government.

The pursuit of politics as usual in Murici and places like it is one reason that next month’s general election is anything but ordinary. The front-runner in the presidential race is Jair Bolsonaro, a right-wing former army captain who rails against conventional politics, praises dictators and has gun-slinging notions of how to fight crime. After a lunatic knifed him at a rally on September 6th, he is campaigning from a hospital bed. Regardless, he is widely expected to enter a run-off vote, which would be held on October 28th (see chart).

The other dominating personality is Luiz Inácio Lula da Silva, a left-wing former president who is in jail after being convicted of corruption. He led the presidential race until August 31st, when Brazil’s top electoral court disqualified him from running. He remains the country’s most popular politician, and its most despised. His replacement as the nominee of the Workers’ Party (PT) is Fernando Haddad, a former mayor of the city of São Paulo. Polls suggest he has the best chance of meeting Mr Bolsonaro in the run-off. If that happens, the presidential election will be a contest between Lula’s party, which is more responsible than any other for the deepest traumas Brazil has suffered since the end of the dictatorship in 1985, and a candidate who represents an extreme response to them. The first of those traumas is the corruption unearthed by the Lava Jato (“Car Wash”) investigations. It involved politicians and parties taking kickbacks from private-sector companies that won contracts from state-owned firms or extracted other benefits from the state. More than a hundred politicians have been investigated; 12 have been convicted, including Lula. His successor, Dilma Rousseff, was impeached in 2016 on unrelated charges. The current president, Michel Temer, a member of the MDB, has avoided trial in the supreme court only because congress voted to protect him from it. The suspects in Alagoas include Mr Calheiros, who faces several inquiries, and Benedito de Lira, a PP senator backed by Mr Gaia who is running for re-election. The second trauma is Brazil’s worst-ever recession, which started as Lava Jato was getting under way in 2014 (see chart). It slashed GDP per person by 10% and dragged back into poverty millions of Brazilians who had entered the middle class. Although growth has resumed, it is a feeble 1.4% a year. A further cause of dismay is crime. The number of murders rose 3% last year, to a record of nearly 64,000.

These crises have shaken Brazilians’ faith in democracy. Just 13% were satisfied with their democracy last year, the lowest share in Latin America, according to Latinobarómetro, a pollster. Rebelliousness has been evident since 2013, when demonstrations in São Paulo over a rise in bus fares spread to other cities and over other issues, including the poor quality of public services. A ten-day strike by lorry drivers in May this year over a rise in fuel prices paralysed the economy and forced the government to restore subsidies temporarily.

At stake in the elections is whether Brazil’s next cohort of leaders can provide good enough governance to contain such conflicts and restore trust in the country’s institutions. That depends in turn on making progress on three big tasks. The first is to rid politics as much as possible of the graft that has brought democracy into disrepute. The second is to avert a slow-moving economic crisis that threatens to condemn Brazil to slow growth, high inflation and impotent government. The third is to reduce violence.

Any government that tries to stabilise Brazil will provoke conflict with groups that lose from reforms. Expect another round with lorry drivers over fuel subsidies, which are scheduled to expire in December. A president serious about cleaning up politics will clash with congressmen whose support he or she will need to pass economic reform. Fighting crime will require better co-ordination between the federal government and the states, and between separate police forces within states. If Mr Bolsonaro becomes president, the next government might accomplish none of the above. Worse, his authoritarian instincts might weaken Brazilian democracy still further.

In theory, the elections offer the possibility of renewal. Brazilians will choose the president, all 513 members of the lower house of congress, two-thirds of the 81-member senate and governors and legislatures in all 27 states. But the way politicking is done in Alagoas shows why renewal will be hard. Voters face a bewildering array of parties, most of which stand for nothing, and candidates, most of whom are non-entities. Nationwide, the number of parties has expanded from seven in 1988 when the constitution was adopted to 35 now; 28 are represented in congress. Most exist only because they are entitled to public money and time on 25-minute-long programmes of advertising, which are broadcast twice a day during campaigns. Aggregator parties like the MDB assemble smaller ones into pre-election coalitions, acquiring their broadcast time in exchange for future government jobs.

Tears of a clown

The plethora of candidates comes from Brazil’s unusual system of “open-list proportional representation” for electing deputies to the lower house of congress and state legislatures. If a candidate amasses more votes than he needs to get elected, the excess is distributed to others in his coalition. Brazilians call this the “Tiririca effect”, after a clown whose spare votes in 2010 brought in three other deputies. Lower-house deputies represent their entire states. This means they have to spend lots of money to get elected and have little connection to their constituents.

In Alagoas, 441 candidates are running for 40 legislative and executive jobs. To anyone concerned about political consistency, their alliances make no sense. On September 6th a drum-banging, flag-waving throng held a march on the outskirts of Maceió, Alagoas’s capital, for Mr Calheiros and his son, Renan Calheiros Filho, the governor. Among the marchers were politicians from the Communist Party as well as the conservative Party of the Republic. A week earlier, the Calheiroses held a rally with Mr Haddad, even though the MDB has its own presidential candidate, Henrique Meirelles, a former finance minister. That is because Lula, Mr Haddad’s mentor, is remembered as a president who brought prosperity to many poor Brazilians, especially in the north-east. “It’s a calculus for political survival,” says an adviser to the Calheiros campaign.

Rather than a mandate for governing, elections held under these conditions produce the opening positions of a game played between the president and a fragmented congress, which Brazilians call presidencialismo de coalição (“coalition presidentialism”). This entails the president assembling a coalition of parties, which has little to do with ideology and may not be the same as the pre-election coalitions, to enact his or her governing programme. The glue is government jobs for supporters, money for crowd-pleasing projects and, especially in recent years, graft on an epic scale.

Brazilians have reached the end of their patience with this system. In a poll conducted late last year, 62% of respondents identified corruption as Brazil’s biggest problem. It is the biggest reason for the rise of Mr Bolsonaro, who portrays himself as a scourge of the establishment, even though he has been a congressman for 28 years and belonged to nine different parties.

Despite the despair, the system has shown that it has some capacity to reform itself. Lava Jato shows that prosecutors and judges are eager to exercise the independence guaranteed to them under the constitution by going after the most powerful people in the country. Politicians and the courts have made modest changes to the electoral system. The supreme court has banned corporate donations to parties, which has cut the cost of this year’s election by 70-80%, estimates Chris Garman of Eurasia Group, a consultancy. Congress has enacted a “performance clause”, which eliminates public funding and media time for parties that get less than 1.5% of the national vote distributed across at least nine states (the threshold will eventually rise to 3%). This may reduce the number of parties in congress.

But the changes these reforms will bring about will be gradual, if they happen at all. One reason is that Lava Jato has sharpened the incentive for politicians to cling to office. That is because sitting politicians can be tried only by the supreme court. At least 30 people suspected of wrongdoing are running for re-election, according to Folha de S.Paulo, a newspaper. Mr Garman estimates that 70% of the new lower house will consist of holdovers from the current one, up from a re-election rate in the current congress of 55%. The ban on corporate donations has made it harder for newcomers to challenge incumbents.

The next congress and president will be caught between the pressure for further reform and a desire for self-preservation. The bolder ideas range from carving up states into electoral districts to scrapping Brazil’s presidential system in favour of a parliamentary one, but it is hard to see legislators changing so drastically the system that elected them. More feasible are proposals to improve regulation of lobbying and procurement by government agencies and state firms. Voters will demand that Lava Jato continue unimpeded; politicians may try to put grit in the judicial machinery. “The political system will try to limit the power of legal institutions whatever the results of the election,” predicts Oscar Vilhena, dean of the law school at Fundação Getulio Vargas, a university. If the next government continues to buy support with pork and patronage, but limits outright bribery, that would be a big improvement.

Bringing economic relief may be easier than attempting political renewal. That is what Mr Temer tried to do after he took over from Ms Rousseff in 2016, with some success. Congress enacted a constitutional amendment that freezes federal spending in real terms at least until 2026. Another reform made the labour market more flexible. Mr Temer came close to a reform of the pension system in May last year, when a newspaper made public an audio tape on which he appeared to endorse the payment of hush money to a politician convicted of taking bribes. Mr Temer spent his political capital to avoid prosecution.

The aborted reform leaves Brazil’s economy in a parlous state. The budget deficit is equivalent to 7% of GDP. Spending on pensions for retired public employees and formal-sector workers accounts for 56% of federal spending and is growing at a rate four percentage points above inflation. Tax giveaways, expanded by Ms Rousseff’s government, are more than 4% of GDP. This, plus the slow growth of the economy, is raising debt to unsustainable levels. Gross public-sector debt rose from 78% of GDP in 2016 to 84% last year.

The danger is not that Brazil will go the way of next-door Argentina, which has had to seek help from the IMF (see article). Unlike Argentina, Brazil owes money mainly in its own currency and to its own citizens, so declines in the value of the real do not greatly increase its net indebtedness. The country has $380bn of reserves, equivalent to a fifth of GDP.

The cupboard is bare

But that does not mean that Brazil is in the clear. Doubts about its financial stability will weigh on the real, which in turn will raise inflation. Real incomes, investment and growth will suffer. With non-discretionary spending such as pension benefits consuming more than 90% of the federal budget, little is left over for such services as health. Many state governments, which are responsible for policing and education among other things, are in even worse fiscal shape. Economists reckon that Brazil needs spending cuts or revenue rises of 300bn reais a year, equivalent to 4% of GDP, to stabilise federal debt.

Most presidential candidates now accept that pensions need to change. That is partly because voters have come to resent a system that lets bureaucrats retire in their 50s, often with full salary. Opposition to the sort of reform that Mr Temer proposed dropped from 68% to 44%, according to polls commissioned by the government. There is also agreement on the need to raise tax revenue, although the details vary among candidates.

Her pension, or his education?

Despite this glimmer of consensus, markets are pessimistic. The real has fallen to a record low against the dollar. In part that is because the candidates likeliest to win the presidency are least equipped to govern. Both the front-runners represent polarising forces. They will have a hard time getting support for reforms. Candidates with the best economic ideas are unlikely to make it into the second round.

Mr Bolsonaro’s main talent is for whipping up public anger. He trumpets a newfound interest in liberal economics. His chief economic adviser is Paulo Guedes, who was educated at the University of Chicago, a nursery of market-minded economists. Mr Bolsonaro belongs to the tiny Social Liberal Party and has few allies. “Our party is the people,” he declares. Unless he makes peace with the political class, he is unlikely to get his reforms through congress.

Mr Haddad, his likeliest opponent in the second round, has a bigger party behind him and was a successful mayor. He promises to put debt “on a downward path”. But his party is less reform-minded than he is. He will struggle to shake the perception that he is Lula’s puppet.

The other main candidates are less polarising, and less likely to push voters into the arms of Mr Bolsonaro in the run-off. All have drawbacks. Ciro Gomes, a left-wing former governor of the north-eastern state of Ceará, favours interventionist policies of the sort that aggravated Brazil’s economic crisis, such as subsidised lending.

Two centrists are mirror images of each other. Geraldo Alckmin, a former governor of the state of São Paulo, is competent and backed by an enormous coalition, which bodes well for his ability to enact economic reforms. But he is colourless and belongs to the Party of Brazilian Social Democracy (PSDB), which is among the most tarnished by Lava Jato. More inspiring is Marina Silva, a former environment minister who was born into an illiterate rubber-tapping family in the Amazon and learned to read when she was 16. Ms Silva shares Mr Bolsonaro’s unwillingness to engage in pork-barrel politics, which will make governing hard. She is more likely than the populist to stick to her resolve.

The voters of Alagoas seem torn between the handouts and compromises that come with old-style politics and the hope of something better. Rodrigo Cunha, a candidate for senator from the PSDB, is promising reform. Running on an anti-corruption platform, he is putting up a strong challenge for one of the two senate seats up for grabs. But Alagoans also have a pragmatic streak. Jurandi Pimentel, an unemployed taxi driver, says he will vote for Mr Cunha, but his other senatorial vote will go to Mr Calheiros. “Alagoas would die without someone who knows how to do politics like the rest of them,” he says.