LONDON (Reuters) - Prime Minister Theresa May must win a vote in parliament to get her Brexit deal approved or risk seeing Britain’s exit from the European Union descend into chaos.

May postponed a parliamentary vote on her deal last month, admitting she was set to lose it, instead pledging to seek assurances from the EU to help win over lawmakers. The vote is now due to take place the week beginning Jan. 14.

To win, May and her ministers will have to overcome opposition from across the political spectrum and defeat attempts to alter or delay the Brexit process or derail it altogether.

Here’s how the voting will work:

WHO?

The debate takes place in the lower house of parliament, the House of Commons. May does not have an outright majority of the 650 lawmakers, and the DUP, the small Northern Irish party that usually props up her government, is opposed to the deal.

May needs 318 votes to get a deal through parliament as seven Sinn Fein lawmakers do not sit, four speakers do not vote and the four tellers are not counted.

WHEN?

Parliament held three days of debate in December before the vote was postponed. The debate is scheduled to restart next Wednesday. The government will propose a timetable for how many days it should last and when the vote will be.

So far the government has set out plans to hold the debate on Jan. 9 and 10. It has also proposed continuing the debate on Jan. 11, although parliament is not due to sit that day.

The December debate was scheduled to last five days, so the restarted debate is expected to continue into the week of Jan. 14, when the government has said the vote will be held.

Each day can last up to eight hours, with start and finish times will vary from day to day.

On the final day, there will be a series of votes: first, to approve or reject up to six amendments to the government’s motion, and then to approve or reject the motion. It is not yet clear what time the voting will start.

WHAT?

The debate will be on whether to approve a motion stating that parliament has approved the Withdrawal Agreement - a legal text setting out the terms of departure - and a separate political declaration outlining the long-term relationship Britain will have with the EU.

WHAT ARE AMENDMENTS?

Lawmakers are able to put forward amendments to this motion. John Bercow, the Speaker of the House, chooses no more than six of these on the final day, and they will be voted on unless the proposers opt to withdraw them.

If approved, an amendment would be included in final motion’s wording. While any successful amendments would not bind the government to comply with them, they would be politically hard to ignore, and could dictate May’s next steps.

Ministers have expressed concerns that if any amendment is passed by parliament, it could prevent the deal being ratified because the final vote may not then provide the legally necessary clear and unequivocal approval of May’s deal.

The amendments will be voted on before the deciding ballot on whether to approve the overall motion - meaning May has to win a series of votes, rather than just one, each with the potential to scupper her plan.

HOW WILL THE RESULT BE ANNOUNCED?

Once the debate is finished, the speaker will typically ask those in favor of each amendment to shout “aye”, and then those against to say “no”. As long as some lawmakers shout “no”, the speaker will call a formal vote, known as a division.

Votes are registered by lawmakers walking through different doorways, out of sight of television cameras and onlookers. Once the headcount is complete - which can take up to 15 minutes - lawmakers return to the debating chamber.

Four appointed tellers will assemble in front of the speaker, and one will read the result out loud.

Once all the amendments have been voted upon, the main motion is put to a vote using the same process.

WHAT HAPPENS IF SHE LOSES?

By law, if the deal is rejected, ministers have 21 days to state how they intend to proceed. The government has previously said that if the agreement is rejected, Britain will leave the EU without a deal on March 29.

The reality is that the huge uncertainty in the world’s fifth largest economy and the likely adverse reaction of financial markets would demand a much quicker political reaction.

Some media have reported May would ask parliament to vote again on the deal. With 117 of her party’s 317 lawmakers having voted against her in a confidence vote in December, she is also likely to come under pressure to resign.