1.


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09 Problem: 10305 - Ordering Tasks
* http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1246
*
* @author Kratzer Kevin
* @version 1.0, 12/23/2009
*
* Method : Ad-Hoc Status : Accepted Runtime: 0.112
*/

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main10305 {

public static void main(String... args) {
Scanner s = new Scanner(System.in);
while (true) {
int n = s.nextInt();
int m = s.nextInt();
if (n == 0 && m == 0) {
return;
}
int[][] rules = new int[m][2];
int[] in = new int[n];
for(int inputLine = 0; inputLine < m; inputLine++) {
int i = s.nextInt();
int j = s.nextInt();
rules[inputLine][0] = i-1;
rules[inputLine][1] = j-1;
in[j-1] = in[j-1] + 1;
}
boolean running = true;
StringBuilder builder = new StringBuilder(n*2);
while(running) {
running = false;
int[] newIn = Arrays.copyOf(in, in.length);
for(int i = 0; i < in.length; i++) {
if(in[i] >= 0) {
running = true;
}
if(in[i] == 0) {
newIn[i] = -1;
builder.append(i+1);
builder.append(' ');
for(int j = 0; j < rules.length; j++) {
if(rules[j][0] == i) {
newIn[rules[j][1]] = newIn[rules[j][1]]-1;
}
}
}
}
in = newIn;
}
builder.replace(builder.length()-1, builder.length(), "\n");
System.out.println(builder.toString());
}
}
}