POLITICO photo-illustration How to watch the Brexit battle for EU agencies like a pro The EU’s medicines and banking agencies are leaving London. Here’s POLITICO’s guide to how their new homes will be decided.

EU affairs ministers and national ambassadors will vote Monday on where the European Medicines Agency (EMA) and the European Banking Authority (EBA) will be based after their Brexit-enforced move from London.

While the Council of the EU and the European Commission came up with a set of technical criteria to select new cities for the two agencies, the jockeying for position in the race to host them has become highly political ahead of Monday's vote.

Here is POLITICO’s guide to all you need to know about the process.

Who wants the agencies?

Twenty-three cities in EU countries have applied through their national governments.

Nineteen cities want to host the EMA: Amsterdam; Athens; Barcelona; Bonn; Bratislava; Brussels; Bucharest; Copenhagen; Dublin; Helsinki; Lille; Malta (a bid by the country, not an individual city); Milan; Porto; Sofia; Stockholm; Vienna; Warsaw; and Zagreb.

However, Malta dropped out of the EMA race on Friday with Dublin (for the EMA only) and Zagreb following suit Monday.

Eight cities want the EBA: Brussels; Dublin; Frankfurt; Luxembourg City; Paris; Prague; Vienna; and Warsaw.

No country can have them both. The ballot for the EMA will take place first and if the country that wins is also in the running for the EBA, it will be automatically excluded from the voting for that agency.

Why does it matter?

The agencies are the first spoils of Brexit that remaining EU countries have to split among themselves. With 23 competitors and only two winners, there's potential for political trouble, especially given that countries in Central and Eastern Europe that don't have an agency have stressed it's their right to get one now.

The agencies can also bring a lot of business to the cities that get them. For the EMA, with almost 900 well-paid employees and tens of thousands of specialists coming to meetings every year, there will be a significant demand for hotel rooms, flights and services.

What happens on Monday?

Representatives of every EU country (minus the U.K.) will gather for the General Affairs Council Article 50 meeting in Brussels.

The meeting begins at 2:30 p.m. with a briefing from EU chief Brexit negotiator Michel Barnier on progress in the talks. About an hour later, the participants will start the ballot for the agencies — first for the EMA and then for the EBA.

How does the voting work?

Each of the 27 countries has voting points to allocate in the first round: three for their preferred bid, two for their second favorite and one for their third preference (see graphic). Each country has to allocate all its six points in this manner for its vote to be valid. The ballots are secret so it will not be possible for anyone to know how each country voted.

If one country manages to obtain maximum voting points from 14 EU countries, it will win the agency. If not, voting goes to a second round, where the top three countries from the first round battle it out. Each country will have one vote to allocate at this stage. If one country receives the support of 14 or more countries, it wins.

Otherwise, a third round will follow among the two bids with the highest number of votes (or all three in case of a tie).

If there’s no winner in the third round, the Estonian presidency will have the unenviable task of making a random choice (most likely by drawing lots, although the precise method isn't specified).

Countries can abstain from voting in any of the rounds or throughout the entire voting process. And in between each round of voting there will be a 30-minute break during which ministers can call their capitals for advice on how to vote in the next round.

Only the final winner will be officially announced, not the results of each round, so anyone outside the room will only hear about preliminary results via unofficial channels (follow POLITICO's live blog on the day for full results). The ballots, likely written on white-colored paper, will be destroyed after voting so there will be no record of the process.

Who's going to win?

The voting system is so complex that it is very hard to predict. Those who are following the EBA relocation process closely see Frankfurt as a strong favorite, but that's far from certain. The race for the EMA is much more open. Betting company Ladbrokes sees Milan as the city with the highest chance to win the EMA (with odds of 2/1), and Frankfurt appears to have the best shot at getting the EBA (odds of 6/4).

The lobbying between countries has been intense in recent months, with health and EU affairs ministers flying all over the Continent to garner support. The only official alliance so far has been between the four countries in the Visegrad Group: the Czech Republic, Slovakia, Poland and Hungary. The latter is not in the running for any of the agencies and has said it will support Bratislava for the EMA. The Czech Republic is expected to vote for Bratislava for the EMA in exchange for Slovakia supporting Prague's bid for the EBA.

Giorgos Katrougalos, the Greek alternate foreign minister for EU affairs, has tried to recruit fellow Southern European countries such as France, Italy, Portugal, Malta and Cyprus to support each other in the first round of voting, but it is not clear if his alliance-building attempt has been successful.

When will we know the results?

It depends how many rounds of voting there are. The EMA decision could come around 5:30 p.m. while the EBA decision will be at around 7 p.m. The Council is expected to communicate the results for each agency after the final voting session is done.

What comes next?

The final results will be noted in Council minutes and the Commission will then have to make changes in the law establishing the EBA, which mentions London as its seat. The EMA does not have that problem, but it still has to be made clear how it will deal with the no-break lease it has at its current home of Canary Wharf.