Ordering tasks#10235

Ordering tasks

1 second
128 megabytes
Very easy

John has tasks to do. Unfortunately, the tasks are not independent and the execution of one task is only possible if other tasks have already been executed.

Input

Consists of several instances of the problem. Each instance begins with a line containing two integers: number of tasks (1 \le n \le 100), numbered from to and number of direct precedence relations between tasks. After this, there will be lines with two integers and , representing the fact that task must be executed before task .

An instance with n = m = 0 is not processed and terminates the input data.

Output

For each instance, print a line with integers representing the tasks in a possible order of execution.

Examples

Example 1

Loading
Loading