#include <iostream>
#include <fstream>
#include <list>
#include <stack>
std::ifstream in("sortaret.in");
std::ofstream out("sortaret.out");
class Graf{
int nr_noduri;
std::list <int> *a;
void __top__(int varf, bool v[],std::stack<int>& s);
public:
Graf (int n) : nr_noduri(n){
a = new std::list<int>[n + 1];
}
void adaugaMuchie(int i, int j);
void top();
};
void Graf::adaugaMuchie(int i, int j){
try{
a[i].push_back(j);
} catch (std::exception a){
return;
}
}
void Graf::__top__(int varf,bool v[], std::stack<int> &s){
v[varf] = true;
std::list<int>::iterator i;
for (i = a[varf].begin(); i != a[varf].end(); ++i)
if (!v[*i])
__top__(*i, v, s);
s.push(varf);
}
void Graf::top(){
std::stack<int> s;
bool* v = new bool[nr_noduri+1];
for (int i = 1; i <= nr_noduri; i++)
v[i] = false;
for (int i = 1; i <= nr_noduri; i++)
if (v[i] == false)
__top__(i, v, s);
while (s.empty() == false) {
out << s.top() << " ";
s.pop();
}
}
int main()
{
/// n = numari noduri, m = numar muchii
int n, m;
in >> n >> m;
Graf graf(n);
while (m--){
int i,j;
in >> i >> j;
graf.adaugaMuchie(i,j);
}
graf.top();
out.close();
in.close();
return 0;
}