import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Sample146 {
	enum Issue {
		Unknown, Win, Lose,
	}

	private final int n;
	private final Issue[][] table;

	public Sample146(int n) {
		this.n = n;
		table = new Issue[n][];
		for (int index = 0; index < n; index++) {
			table[index] = new Issue[n];
			Arrays.fill(table[index], Issue.Unknown);
		}
	}

	public void add(int win, int lose) {
		table[win - 1][lose - 1] = Issue.Win;
		table[lose - 1][win - 1] = Issue.Lose;
	}

	public int[] calc() {
		List<Issue[][]> tableList = createAllTable();
		List<int[]> resultList = createResultList(tableList);

		int[] result = resultList.get(0);
		result[n] = (resultList.size() > 1)? 1: 0;
		return result;
	}

	private List<Issue[][]> createAllTable() {
		List<Issue[][]> tableList = new ArrayList<Issue[][]>();
		tableList.add(copyTable(table));
		for (int team = 0; team < n - 1; team++) {
			for (int opp = team + 1; opp < n; opp++) {
				if (table[team][opp] == Issue.Unknown) {
					for (Issue[][] res: tableList.toArray(new Issue[0][][])) {
						res[team][opp] = Issue.Win;
						res[opp][team] = Issue.Lose;

						Issue[][] copy = copyTable(res);
						copy[team][opp] = Issue.Lose;
						copy[opp][team] = Issue.Win;
						tableList.add(copy);
					}
				}
			}
		}
		return tableList;
	}
	private Issue[][] copyTable(Issue[][] table) {
		Issue[][] copy = new Issue[table.length][];
		int index = 0;
		for (Issue[] row: table) {
			copy[index++] = copyRow(row);
		}
		return copy;
	}
	private Issue[] copyRow(Issue[] row) {
		Issue[] copy = new Issue[row.length];
		int index = 0;
		for (Issue issue: row) {
			copy[index++] = issue;
		}
		return copy;
	}
	private List<int[]> createResultList(List<Issue[][]> tables) {
		List<int[]> list = new ArrayList<int[]>();
		OUTER: for (Issue[][] table: tables) {
			int[] count = new int[n];
			for (int team = 0; team < table.length; team++) {
				for (Issue issue: table[team]) {
					if (issue == Issue.Win) count[team]++;
				}
			}
			int[] result = new int[n + 1];
			for (int team = 0; team < n; team++) {
				result[n - 1 - count[team]] = team + 1;
			}
			for (int order = 0; order < n; order++) {
				if (result[order] == 0) continue OUTER;
			}
			list.add(result);
		}
		return list;
	}


	private static int[] toIntArray(String[] input) {
		int[] result = new int[input.length];
		int index = 0;
		for (String s : input) {
			result[index++] = Integer.parseInt(s);
		}
		return result;
	}

	public static void main(String[] args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			int n = Integer.parseInt(reader.readLine());
			Sample146 sample = new Sample146(n);
			int m = Integer.parseInt(reader.readLine());
			for (int index = 0; index < m; index++) {
				int[] array = toIntArray(reader.readLine().split("\\s+"));
				sample.add(array[0], array[1]);
			}
			int[] result = sample.calc();
			for (int i: result) {
				System.out.println(i);
			}
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}
