// torne ora.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#define ll long long
using namespace std;
struct adat
{
ll db,szam;
vector<ll>sz;
};
ll n, k, i,a,b;
bool t,p;
int hasonlit(adat a, adat b)
{
t = false;
p = false;
if (a.db > b.db) return 1;
else if (a.db == b.db)
{
for (auto& e : a.sz)
if (e == b.szam) t = true;
for (auto& e : b.sz)
if (e == a.szam) p = true;
if (t) return 0;
else if (p) return 1;
}
else return 0;
}
int main()
{
cin >> n >> k;
deque<adat>x(n + 1);
for (i = 1; i <= k; ++i)
{
cin >> a >> b;
x[b].sz.push_back(a);
x[a].db++;
x[a].szam = a;
x[b].szam = b;
}
x.pop_front();
sort(x.begin(), x.end(), hasonlit);
for (auto& e : x) cout << e.szam << " ";
return 0;
}
/*
5 9
3 1
3 5
3 4
4 2
3 2
1 4
1 2
1 5
5 4
*/
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file