#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
int in[100005];
vector <int> v[100005];
bool vis[100005];
priority_queue <int, vector <int>, greater <int>> q;
int n, m, x, y;
int main(){
cin >> n >> m;
for(int i = 1; i <= m; i++){
cin >> x >> y;
v[x].push_back(y), in[y];
}
for(int i = 1; i <= n; i){
if(in[i] == 0) vis[i] = 1, q.push(i);
}
while(!q.empty()){
int head = q.top();
q.pop();
cout << head << ' ';
for(int i:v[head]){
if(!vis[i] && --in[i] == 0) vis[i] = 1, q.push(i);
}
}
}