If Donald Trump and Bernie Sanders win their parties’ respective presidential nominations, and former New York City Mayor Michael Bloomberg throws his hat in the ring—as he has said he might—he could “precipitate one of the worst constitutional crises in American history,” according to a Yale Law School professor.

The problems arise from the little-known, bizarre terms of the Twelfth Amendment, which was enacted in 1804. Constitutional law scholar Bruce Ackerman lays out the doomsday scenario in a column in the Los Angeles Times today.

If I understand him correctly—and that’s a big if—problems will begin if no candidate wins a majority of the 270 votes in the electoral college, a distinct possibility in a three-person race.

The Twelfth Amendment then turns the race over to the House of Representatives, Ackerman says, but observing unique, one-time-only rules. Each state caucus gets just one vote, and the candidate needs to win 26 states to prevail. Tiny states will exercise preposterously outsize sway, and if a given state’s caucus ballots result in a tie, that state will get no vote at all in the election.

If the House is stymied past January 20, things will get even weirder, Ackerman continues. The new vice president-elect is supposed to become interim president, but of course the vice presidential race will be mired in the same quagmire afflicting the main event.

At that point, the amendment provides, the vice-presidential race (but not the presidential one) kicks over to the Senate. So, depending on the complexion of the new Senate, that body could end up electing Sanders’ running mate—Elizabeth Warren, say—as acting commander in chief.

Such a result would presumably throw the Republican House into a conniption, driving it to finally unite behind a compromise candidate, which Ackerman surmises would be Bloomberg. (Though a Trump-Warren final outcome would be even more mind-bending.)

Ackerman concludes by appealing to Bloomberg not to set us down this Rube Goldberg machine path to political Armageddon. “If Bloomberg is a true patriot,” the professor writes, “he will not allow his personal ambition to throw the United States into a grave constitutional crisis.”