BRUSSELS — Nine European cities are vying to win a voting contest to host the planned EU Customs Authority.

Staffed by around 250 well-paid EU officials, EUCA will coordinate oversight of imports of everything from sketchy plastic toys to non-compliant cosmetics and illegal drugs. Its new home base has been the target of intense lobbying, with cities from Portugal to Romania bidding.

On Wednesday in Brussels, representatives of national governments and EU lawmakers will separately select their two favorites and then reveal them to each other. If there’s a single match, that candidate will be selected. If not, further rounds of joint voting will be held to pick the final winner.

Multiple people involved in the deliberations of the Parliament and the Council told POLITICO that Porto, Liège and Bucharest looked to be out of the race. Lille, Warsaw, Málaga, Zagreb and The Hague have a decent chance of advancing, while Rome might also scrape through. We’ve rated all the bids.

Warsaw and Lille can count on strong backing in both institutions, but the sheer complexity of the process might mean they miss out on the prize.

“It’s a bit like Eurovision: Countries tend to vote for their neighbors, regardless of the quality of the song,” quipped one EU diplomat.

Here’s how it would work:

Part 1: Council

The EU capitals will need at least two — and maybe four — rounds to select their duo, plus a final one to rank them. The first round starts with each national delegation spreading 15 points across five different candidates. The favorite city gets five points, the second four, and so on. Once the points are counted, the top five cities advance to the next round. They would be joined by a sixth city in case there’s a tie for fifth spot.

Next, delegations divide six points into a 3-2-1 schedule. This round might already decide the Council’s two candidates, but only if the two top contenders are backed by at least 14 delegations — a majority of the 27 EU capitals.

That outcome is quite unlikely, meaning that a third round would probably have to be held with the top three candidates. In this round, only three points are to be handed out to each capital — two points for their first choice and one point for the second — but they can also strategically abstain: If fewer than 21 of them submit a vote, a fourth round would take place.

Regardless of how many cities enter round four, diplomats will have six points to play with — four points for their top candidate, and two points for the second. The two highest-ranking candidates win here. A final round is then used to rank the top two.

The real voting is, of course, decided much further in advance. Croatian Prime Minister Andrej Plenković invited fellow national leaders from the center-right European People’s Party to an informal get-together in Zagreb in January, at which the customs HQ came up. His argument: Croatia hosts no EU agency at all, despite joining the bloc in 2013.

Warsaw argues, meanwhile, that it can push cooperation between customs and the Frontex border protection agency that is also located there. And PM Donald Tusk is another EPP mastodon.

Part 2: Parliament

In the European Parliament, the voting will be a lot simpler. The lead lawmakers on the file — one for each political group in the chamber — will cast their votes based on the representation of their groups on the Internal Market and Consumer Protection committee.

This gives the European People’s Party the upper hand, as they have 14 out of 51 votes. The Socialists and Democrats hold 11, with Renew, Patriots for Europe and the European Conservatives and Reformists all on six. The Greens will have four votes and both The Left and the Europe of Sovereign Nations two.

All parties have internally decided which candidates to back, with the EPP for instance opting for Warsaw, Zagreb and Málaga. Based on a rough tally, Lille, Málaga and Warsaw are polling well among MEPs. And Rome isn’t out of contention, either.

The city with the lowest number of points will drop out at the end of each round until two remain.

Part 3: The Reveal

Once both institutions have their two candidates, they will reveal them to each other — that is expected at around lunchtime. If there’s only one in common, that city automatically wins the contest. With a roster of two or four, a joint voting procedure kicks in.

Part 4: The Joint Vote

The Council and the Parliament will both get 27 votes, with lawmakers represented by lead negotiator Dirk Gotink of the EPP and Anna Cavazzini of the Greens. In the first joint round of voting, the winning city would need 14 votes on either side of the divide. If there are more than two candidates, the two lowest drop out of the race.

If the double majority doesn’t produce a winner, two cities then advance to a second round. From then on there will be no requirement for a double majority: Collecting 41 out of all 54 votes will suffice. If no candidate musters that, a third vote with 36 required to win follows.

This two-thirds majority vote would take place three times. If those fail to produce a winner, a simple majority of 28 votes would suffice to finally pick the winner.

And finally …

After spending the better part of the day picking the city, negotiators from the Cyprus presidency of the Council and the Parliament will be joined on Thursday by the Commission to finalize the underlying customs reform. This is expected to be the final round, resulting in a political deal. Any delays would cause issues down the line for an EU-wide fee to stem the immense flow of e-commerce packages from outside the bloc.

“Let’s get this all done,” the Parliament’s lead negotiator Dirk Gotink told reporters last week. “There is political will.”