Time limit
2s
Memory limit
128 MB
Mino plans to solve all N problems numbered from 1 to N. A smaller number means an easier problem: problem 1 is the easiest, and problem N is the hardest.
While reviewing the problems, Mino found that some problems become easier after solving certain other problems first. Mino wants to choose an order that satisfies these rules.
Given the number of problems and the before relations, write a program that outputs the order in which Mino should solve the problems.
The first line contains the number of problems N (1 ≤ N ≤ 32,000) and the number of before relations M (1 ≤ M ≤ 100,000).
Each of the next M lines contains two integers A and B separated by a space. This means problem A should be solved before problem B.
The input is always such that all problems can be solved.
On the first line, output the problem numbers from 1 to N in the order Mino should solve them, separated by spaces.