Run Kahn's algorithm to get the topological order of the cities.
If the graph has a cycle, topological sort fails, which means there's no valid route (you'd loop forever).
Initialize dist[1] = 0 (city is the start, edges to reach it). Set all other dist[i] = -Infinity (not reachable yet).
Process cities in topological order.
For each city with dist[u] != -Infinity: For each neighbor where edge exists: If dist[u] + 1 > dist[v]: Update dist[v] = dist[u] + 1 and set parent[v] = u.
After processing all cities, check dist[n].
If dist[n] = -Infinity, print IMPOSSIBLE. Otherwise, reconstruct the path using the parent array.
This runs in time and uses space.