Even before it was decimated by Hurricane Maria, Puerto Rico was staggering under a decade-long recession and debt crisis. The United States territory owes something around $72 billion, which it cannot repay: Massive tax hikes and spending cuts to fund the debt have already wrecked the island's economy — a doom loop that make its debt burden worse, not better.

On Tuesday, in standard fashion, President Trump offered the most simple of solutions: Just cancel Puerto Rico's debt. "They owe a lot of money to your friends on Wall Street, and we're going to have to wipe that out," Trump told Fox News correspondent Geraldo Rivera. "You can say goodbye to that. I don't know if it's Goldman Sachs, but whoever it is, you can wave goodbye to that."

Can it be done? In theory, yes. Kind of.

Debts are just legal contracts, after all. They're governed by laws, and laws can be rewritten. But the key questions for Puerto Rico are: Which laws would be rewritten and who gets to hold the pen?

Because it won't be Puerto Rico itself. While the island's elected government actually passed a law in April 2016 saying it wasn't going to pay back some of the bonds, it can be overruled by the U.S. Congress and the courts.

Trump similarly can't just "wipe out" the debt unilaterally under his executive powers. And while it's theoretically conceivable that Congress could pass — and Trump could sign — a law canceling the debt, this would almost certainly set off a round of constitutional challenges that could wind up in the Supreme Court. Ultimately, the Constitution prohibits depriving people of property without due process— i.e. their day in court — so this path is risky indeed.

If Trump was serious about this issue — and there's ample reason to doubt he is — then his best bet would be to press Congress to change some of the weird quirks in federal law governing the island.

Like U.S. states, the territorial government of Puerto Rico is barred from declaring bankruptcy. In fact, a lot of the political resistance to helping Puerto Rico is driven by fear it would open the door for some distressed state governments to write down their debt as well. But most U.S. municipalities and local governments can declare bankruptcy under Chapter Nine in the bankruptcy code. This allows them to go to court to figure out a repayment plan, get their debt obligations reduced, and get an extension on paying off those obligations. And a lot of Puerto Rico's debt is actually owed by the island's local municipalities.

The problem is, an obscure 1984 law bars Puerto Rico's various municipalities and utilities from accessing Chapter Nine, for reasons that baffle even Supreme Court justices. In March 2016, the island even made its case to the Supreme Court that this treatment was unlawful. And Congress flirted with the idea of dropping the prohibition. But the wealthy investors and secretive hedge funds that own much of Puerto Rico's debt didn't like the level of bargaining power a Chapter Nine-style bankruptcy would give the island. So they leaned on Republicans and conservative lawmakers with a big lobbying campaign, even charging that bankruptcy would be a "bailout" for Puerto Rico — a ridiculous notion, as the debt would be written down as opposed to paid off by the U.S. government.

(In fact, this was the hedge funds' play from the beginning: They knew Puerto Rico was in distress, so they swooped in and bought up its debt super cheap, then tried to make a killing by pushing the courts to force Puerto Rico pay back every last cent.)

If the 1984 prohibition had simply been dropped and Puerto Rico was allowed to file a regular Chapter Nine bankruptcy, then it might have gotten a lot of its debt written off. Unfortunately, that's not what happened.

Under pressure from investors, Congress passed, and President Obama signed, the Puerto Rico Oversight, Management, and Economic Stability Act (PROMESA) in 2016. This law created a new version of bankruptcy, similar to Chapter Nine, that Puerto Rico could access. But there were catches. Creditors get more leverage in a PROMESA bankruptcy than they'd get in Chapter Nine. PROMESA also imposed a federally-appointed oversight board on Puerto Rico, which effectively acts as the island's representative in the bankruptcy proceedings, and Puerto Rico must accept whatever deal the board strikes on its behalf.

The board also has sweeping powers to unilaterally restructure the island's safety net spending, public investment, minimum wage laws, and more, in the name of repaying the debt — all with no input from Puerto Rico's elected lawmakers. So while the board is pushing to cancel some of Puerto Rico's debt, it has also imposed savage cuts to spending and public pension programs, ensuring the island's recession will continue.

Changing this onerous law is Trump's best shot at real debt relief for Puerto Rico. He could ask Congress to simply rewrite the law: bring the PROMESA bankruptcy proceedings into line with Chapter Nine and ideally just scrap the oversight board entirely — or at least rein in its powers and make it more democratically accountable to the island's residents. But as they showed in the previous struggle around the law, most Republicans would balk at giving Puerto Rico that kind of power in debt negotiations, no matter what Trump says.

An even better solution, albeit an even less likely one, would be to just make Puerto Rico a state, automatically giving it full access to Chapter Nine bankruptcy and to the federal countercyclical spending that props up other state economies. But Republicans are vehemently opposed to letting this Democrat-majority territory gain statehood and full representation in Washington.

At the end of the day, Trump simply can't help Puerto Rico unless his party has a dramatic change of heart or is booted from power. And within the next few years, only one of those two options is at all likely.