#include <iostream>
#include <stdio.h>
#include <queue>
#include <vector>

using namespace std;
vector<int> adj[32005];
queue<int> q;
int n,m, in[32005], visited[32005];

int main()
{
    int a,b;
    scanf("%d%d", &n,&m);
    for(int i=0;i<m;i++){
        scanf("%d%d", &a,&b);
        adj[a].push_back(b);
        in[b]++;
    }
    for(int i=1;i<=n;i++){
        if(in[i]==0){
            q.push(i); visited[i]=1;
        }
    }
    while(!q.empty()){
        int here=q.front(); q.pop();
        printf("%d ", here);
        for(int i=0;i<adj[here].size();i++){
            int there=adj[here][i];
            in[there]--;
            if(in[there]==0){
                q.push(there); visited[there]=1;
            }
        }
    }
    return 0;
}