The Iran nuclear deal is now sealed — from Washington’s end. But since this has been one of America’s most important foreign policy shifts in the last four decades, it’s worth looking back and grading the performance of the key players.

Iran’s supreme leader, Ayatollah Ali Khamenei. Grade: A.

His prediction last week that Israel won’t be around in “25 years” was perfectly timed to complicate President Obama’s effort to get the deal through Congress. Khamenei is a bad guy. When I asked a Middle East expert friend to explain Khamenei’s behavior, he invoked a Yiddish curse on the Iranian: “May all his teeth fall out, except the ones that hurt.”

But he’s also a clever guy. Through this deal Khamenei gets Iran out from under crippling sanctions, which his people want, by pushing the breakout time for Iran to make a nuclear bomb from two months to a year — for 15 years — but getting the world to bless Iran’s “peaceful” nuclear enrichment program, even though it cheated its way there. And he’s done it all while giving his hard-line base the feeling that he’s still actually against this deal and his negotiators the feeling that he’s for it. So all his options are open, depending on how the deal goes.

Hat’s off, Ali, you’re good. When I sell my house, could I give you a call?

But here’s a note to his parents: “Ali got an A, but he has a tendency to get cocky. He is confident that he can pull off this deal without any transformation in Iran’s domestic politics. I suggest you buy him a good biography of Mikhail Gorbachev.”