How will our solar system end? A distant planet offers hints