The problem statement says that => " If the ball cannot reach the hole, output "impossible". But In the second example ball can reach the hole with "uld" path.
"The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction."
So in the second example, the ball won't stop until it rolls to row 0.