Problem: Message Route (CSES). There are computers numbered to and bidirectional connections. Find the shortest path from computer to computer . If a path exists, print its length and the nodes along the path. If no path exists, print IMPOSSIBLE.
This is a textbook BFS problem. Run BFS from node . If you reach node , reconstruct the path using a parent array. If BFS finishes without reaching , the answer is IMPOSSIBLE. The challenge here is path reconstruction, not finding the distance.