#include <bits/stdc++.h>
#define NMAX 50000
using namespace std;
ifstream fin("sortaret.in");
ofstream fout("sortaret.out");
int n, m, x, y;
vector<int> graf[NMAX + 2];
int gr[NMAX + 2];
queue<int> q;
int main() {
ios_base::sync_with_stdio(false);
fin.tie(NULL);
fout.tie(NULL);
fin >> n >> m;
for (int i = 1; i <= m; i++) {
fin >> x >> y;
graf[x].emplace_back(y);
gr[y]++;
}
for (int i = 1; i <= n; i++) {
if (!gr[i]) {
q.push(i);
}
}
while (!q.empty()) {
int nod = q.front();
fout << nod << ' ';
q.pop();
for (int vec : graf[nod]) {
gr[vec]--;
if (!gr[vec]) {
q.push(vec);
}
}
}
return 0;
}