#include<stdio.h>
#include<vector>
#include<queue>
using namespace std;
vector<int> edge[501];
priority_queue<int, vector<int>,greater<int> > Q; // 小顶堆
int main()
{
int inDegree[501];
int n,m;
while(scanf("%d%d",&n,&m)!=EOF){
for(int i=1;i<=n;i++){
inDegree[i]=0; edge[i].clear();
}
while(m--){
int a,b;
scanf("%d%d",&a,&b);
inDegree[b]++;
edge[a].push_back(b);
}
while(Q.empty()==false) Q.pop();
for(int i=1;i<=n;i++){
if(inDegree[i]==0) Q.push(i);
}
int cnt=0;
while(Q.empty()==false){
int nowP=Q.top();
if(cnt!=n-1) printf("%d ",nowP);
else printf("%d\n",nowP);
Q.pop();
cnt++;
for(int i=0;i<edge[nowP].size();i++){
inDegree[edge[nowP][i]]--;
if(inDegree[edge[nowP][i]]==0){
Q.push(edge[nowP][i]);
}
}
}
}
return 0;
}
#include<vector>
#include<queue>
using namespace std;
vector<int> edge[501];
priority_queue<int, vector<int>,greater<int> > Q; // 小顶堆
int main()
{
int inDegree[501];
int n,m;
while(scanf("%d%d",&n,&m)!=EOF){
for(int i=1;i<=n;i++){
inDegree[i]=0; edge[i].clear();
}
while(m--){
int a,b;
scanf("%d%d",&a,&b);
inDegree[b]++;
edge[a].push_back(b);
}
while(Q.empty()==false) Q.pop();
for(int i=1;i<=n;i++){
if(inDegree[i]==0) Q.push(i);
}
int cnt=0;
while(Q.empty()==false){
int nowP=Q.top();
if(cnt!=n-1) printf("%d ",nowP);
else printf("%d\n",nowP);
Q.pop();
cnt++;
for(int i=0;i<edge[nowP].size();i++){
inDegree[edge[nowP][i]]--;
if(inDegree[edge[nowP][i]]==0){
Q.push(edge[nowP][i]);
}
}
}
}
return 0;
}