#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int n, m, st[N], en[N], head[N], prv[N], cmp_cnt, cnt[N], dp[N], nst[N], nen[N],
    nhead[N], nprv[N], rst[N], ren[N], rhead[N], rprv[N];
vector<int> tps;
bool mark[N];
void dfs(int v) {
  mark[v] = 1;
  for (int e = head[v]; e != -1; e = prv[e]) {
    int u = en[e];
    if (!mark[u]) dfs(u);
  }
  tps.push_back(v);
}
int main() {
  memset(head, -1, sizeof(head));
  memset(prv, -1, sizeof(prv));
  cin >> n >> m, n++;
  for (int i = 0; i < m; i++) {
    cin >> st[i] >> en[i];
    st[i]--, en[i]--;
    prv[i] = head[st[i]], head[st[i]] = i;
  }
  dfs(0);
  return 0;
}
