Skip to content
UPEEC

Course Order

Medium#graphs#topological-sort· solved by 0 · time limit 2.0 s

There are nn UPEEC courses. Each pair a b means course aa must be finished before course bb. Print an order to take all courses — when several courses are available, take the smallest-numbered first. Print IMPOSSIBLE if there's a cycle.

Input

nn and mm, then mm lines a b.

Output

The order, or IMPOSSIBLE.

Constraints

1≤n≤1051 \le n \le 10^5, 0≤m≤2×1050 \le m \le 2 \times 10^5

Sample 1

Input

4 3
1 2
1 3
3 4

Output

1 2 3 4

Sample 2

Input

2 2
1 2
2 1

Output

IMPOSSIBLE

Sign in or join free to run and submit your solution.