cute puzzle
kd8 , losing the rook was better
If you analyze the position with Stockfish, you'll see that Kd8 is worse for BlackBut either way it'll be completely winning for White no matter what Black plays in that position