One of the most enduring legacies of the next president will flow from a few words in Article II, Section 2 of the Constitution: the power to nominate justices to the Supreme Court. With the court still shorthanded after the death of conservative Justice Antonin Scalia, and with two of its sitting justices older than 80, the next president will shape the court, and through it the law of the land, for decades to come.

This has not been lost on the candidates.

“The replacement for Justice Scalia will be a person of similar views and principles. This will be one of the most important issues decided by this election,” Donald Trump said in his convention speech last week.

“If you don’t believe this election is important, if you think you can sit it out, take a moment to think about the Supreme Court justices that Donald Trump would nominate and what that would mean to civil liberties, equal rights and the future of our country,” Bernie Sanders said this week at the Democratic National Convention.

And Hillary Clinton said in her acceptance speech at the Democratic National Convention: “We need to appoint Supreme Court justices who will get money out of politics and expand voting rights, not restrict them. And we’ll pass a constitutional amendment to overturn Citizens United!”

Clearly, the court will take a different shape under a President Trump than it would a President Clinton. But just how different, and how quickly? Very different and, if Clinton wins, very quickly. If Donald Trump is elected president, the Supreme Court may, seat by vacated seat, move rightward toward its most conservative position in recent memory. If Hillary Clinton is elected, the court may quickly become the most liberal it’s been in at least 80 years.

To look into the future of the court, I simulated 10,000 hypothetical future Supreme Courts (and their vacancies) under both a President Trump and a President Clinton, looking at what the ideology of the likely swing justice would be. (I used Martin-Quinn scores for justice ideology.) Specifically, I looked at the ideology of the court’s “median justice” in the scenarios, figuring that the person in the middle would be the person most likely to swing in tight cases.

Clinton’s Supreme Court leverage lies in the short term: She could appoint a left-leaning justice to replace the solidly conservative Scalia, at which point the median justice would almost certainly become either Justice Stephen Breyer or Clinton’s appointee, either being reliably liberal. Prior to Scalia’s death in February, the moderate Justice Anthony Kennedy was the median justice.

Trump’s leverage, meanwhile, lies in the medium term: Trump’s conservative pick to replace Scalia would almost certainly restore the status quo before Scalia died, with Kennedy as the median. However, the three oldest justices — Ruth Bader Ginsburg (83 years old), Kennedy (80) and Breyer (78 in August) — are liberal or moderate. Thanks to the relentless, unidirectional drumbeat of time, Trump would have a good chance to replace at least one of those justices, pushing the court in a conservative direction. On the other hand, the oldest of the three sitting conservative stalwarts — John Roberts, Samuel Alito and Clarence Thomas — is only 68.

Any analysis of hypothetical scenarios like this has several assumptions baked in, assumptions that affect things like the findings above. Here are a few big ones I made, and why I made them:

Scalia’s seat on the court remains empty until the new president takes office. Merrick Garland, President Obama’s nominee and the chief judge of the U.S. Court of Appeals for the D.C. Circuit, recently set the record for the longest wait by a nominee for a Senate hearing, and there’s no end in sight. Senate Majority Leader Mitch McConnell said that “this vacancy should not be filled until we have a new president.” Given the evidence, I assumed just that: Whoever is elected president (including Clinton) will pick his or her own nominee to fill Scalia’s seat.

Whenever Future Trump has a seat to fill, I assumed he aims for a Scalia ideology-lookalike. In May, Trump said he plans to do as much: “Justice Scalia was a remarkable person and a brilliant Supreme Court Justice.” But I also assumed there’s some uncertainty in the ideology of the nominee, some noise in the selection.

When Future Clinton has a seat to fill, I assumed she aims for a solidly moderate liberal — someone with an ideology just a bit to the right of Breyer, for example. (She has described her ideal justice as liberal on many issues.) Again, I assumed there’s some uncertainty in the ideology of a Clinton nominee.

To simulate new vacancies on the court, I only forecasted justices’ deaths, not their retirements. That wasn’t to ignore the possibility of retirement, but to temper the model’s assumptions on when vacancies would open up. I used mortality probabilities from the Centers for Disease Control. The CDC data are just estimates for my purposes, and are calculated for the general population. They may somewhat overstate the probability of justices’ deaths, who are well off, have safe jobs and so forth. But when you consider that some recent justices — Sandra Day O’Connor, John Paul Stevens and David Souter — left via retirement rather than death, these probabilities are likely a fairly conservative estimate of court turnover. Death is its own kind of retirement.

If the simulation is accurate, the median justice during Trump’s or Clinton’s presidency could become one of the most extreme in almost a century. Some historical context: By the Martin-Quinn measure, one of the most liberal median justices of the last century was Thurgood Marshall, a champion for civil rights who argued that the death penalty was unconstitutional in all cases. One of the most conservative median justices was Byron White, who, despite being appointed by President Kennedy, dissented in the court’s liberal decisions in Roe v. Wade and Miranda v. Arizona.

VACANCIES* IN FOUR YEARS IN EIGHT YEARS 0 32.6% 5.7% 1 40.7 22.7 2 20.5 34.3 3 5.3 25.4 4 0.7 9.7 5 0.0 2.0 6 0.0 0.2 Chance of vacancies on the Supreme Court * In addition to the seat left vacant by Scalia’s death BASED ON DATA FROM THE CDC

These two hypothetical presidents may well desire even more more purely conservative or liberal justices than the one my model allows them. But Congress may not let that happen. My colleague Harry Enten has argued that getting another Kagan or Sotomayor confirmed, for example, has become “considerably more difficult.” This is thanks to Republican gains in the Senate and an increased importance of ideology over professional qualifications. What’s more, the 2016 race for control of the Senate looks close.

One thing is certain: This is a high-leverage election, judicially speaking. In addition to Scalia’s vacant seat, about one justice is expected to die in the next four years, and just over two in the next eight years.