//裸拓扑排序,注意先输出比较小的数,使用优先队列即可
#include <cstdio>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
const int maxn = ;
vector<int> v[maxn];
priority_queue<int> q;
int f[maxn];
int main()
{
int n,m,x,y;
while(~scanf("%d%d",&n,&m))
{
memset(f,,sizeof f);
for(int i = ; i <= n; ++i)
v[i].clear();
while(m--)
{
scanf("%d%d",&x,&y);
v[x].push_back(y);
++f[y];
}
for(int i = ; i <= n; ++i)
if(f[i] == )
q.push(-i);//默认大根堆
bool flag = true;
while(!q.empty())
{
int t = -q.top(); q.pop();
if(flag) { printf("%d",t); flag = false;}
else printf(" %d",t);
for(int i = ; i < v[t].size(); ++i)
if(!(--f[v[t][i]])) q.push(-v[t][i]);
}
printf("\n");
}
return ;
}