#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
vector<int>edgelist[MAX];
int n,m,i;
int main(){
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
while(scanf("%d%d",&n,&m)==2&&n+m!=0){
for(i=0;i<m;i++){
int x,y;
scanf("%d%d",&x,&y);
edgelist[x].push_back(y);
}
vector<int>in(n+1,0);
for(i=1;i<=n;i++){
for(int j=0;j<edgelist[i].size();j++)in[edgelist[i][j]]++;
}
queue<int>q;
for(i=1;i<=n;i++){
if(in[i]==0)q.push(i);
}
vector<int>top_sort;
vector<int>visited(n+1,0);
while(!q.empty()){
int u=q.front();
q.pop();
top_sort.push_back(u);
for(i=0;i<edgelist[u].size();i++){
int v=edgelist[u][i];
--in[v];
if(in[v]==0&&visited[v]!=1){
q.push(v);
visited[v]=1;
}
}
}
for(i=0;i<top_sort.size();i++){
printf("%d",top_sort[i]);
if(i!=top_sort.size()-1)printf(" ");
}
printf("\n");
for(i=0;i<n;i++)edgelist[i].clear();
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBNQVggMTAwMAp2ZWN0b3I8aW50PmVkZ2VsaXN0W01BWF07CmludCBuLG0saTsKaW50IG1haW4oKXsKICAgIC8vZnJlb3BlbigiaW4udHh0IiwiciIsc3RkaW4pOwogICAgLy9mcmVvcGVuKCJvdXQudHh0IiwidyIsc3Rkb3V0KTsKICAgIHdoaWxlKHNjYW5mKCIlZCVkIiwmbiwmbSk9PTImJm4rbSE9MCl7CiAgICAgICAgZm9yKGk9MDtpPG07aSsrKXsKICAgICAgICAgICAgaW50IHgseTsKICAgICAgICAgICAgc2NhbmYoIiVkJWQiLCZ4LCZ5KTsKICAgICAgICAgICAgZWRnZWxpc3RbeF0ucHVzaF9iYWNrKHkpOwogICAgICAgIH0KICAgICAgICB2ZWN0b3I8aW50PmluKG4rMSwwKTsKICAgICAgICBmb3IoaT0xO2k8PW47aSsrKXsKICAgICAgICAgICAgZm9yKGludCBqPTA7ajxlZGdlbGlzdFtpXS5zaXplKCk7aisrKWluW2VkZ2VsaXN0W2ldW2pdXSsrOwogICAgICAgIH0KICAgICAgICBxdWV1ZTxpbnQ+cTsKICAgICAgICBmb3IoaT0xO2k8PW47aSsrKXsKICAgICAgICAgICAgaWYoaW5baV09PTApcS5wdXNoKGkpOwogICAgICAgIH0KICAgICAgICB2ZWN0b3I8aW50PnRvcF9zb3J0OwogICAgICAgIHZlY3RvcjxpbnQ+dmlzaXRlZChuKzEsMCk7CiAgICAgICAgd2hpbGUoIXEuZW1wdHkoKSl7CiAgICAgICAgICAgIGludCB1PXEuZnJvbnQoKTsKICAgICAgICAgICAgcS5wb3AoKTsKICAgICAgICAgICAgdG9wX3NvcnQucHVzaF9iYWNrKHUpOwogICAgICAgICAgICBmb3IoaT0wO2k8ZWRnZWxpc3RbdV0uc2l6ZSgpO2krKyl7CiAgICAgICAgICAgICAgICBpbnQgdj1lZGdlbGlzdFt1XVtpXTsKICAgICAgICAgICAgICAgIC0taW5bdl07CiAgICAgICAgICAgICAgICBpZihpblt2XT09MCYmdmlzaXRlZFt2XSE9MSl7CiAgICAgICAgICAgICAgICAgICAgcS5wdXNoKHYpOwogICAgICAgICAgICAgICAgICAgIHZpc2l0ZWRbdl09MTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBmb3IoaT0wO2k8dG9wX3NvcnQuc2l6ZSgpO2krKyl7CiAgICAgICAgICAgIHByaW50ZigiJWQiLHRvcF9zb3J0W2ldKTsKICAgICAgICAgICAgaWYoaSE9dG9wX3NvcnQuc2l6ZSgpLTEpcHJpbnRmKCIgIik7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgICAgICBmb3IoaT0wO2k8bjtpKyspZWRnZWxpc3RbaV0uY2xlYXIoKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==