Core idea: This is a direct Euler circuit problem.
Conditions to check: Every vertex has even degree
The graph is connected (all vertices with edges are reachable from vertex )
If either condition fails, output "IMPOSSIBLE".
Why must we start at vertex ? The problem says we start and end at the post office (vertex ). Since it's a circuit, we can start anywhere, but we need in our output.
If has no edges, output "IMPOSSIBLE" (can't leave the post office).