#include <bits/stdc++.h>
#include <ext/algorithm>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define endl '\n'
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> indeg(n);
vector<vector<int>> g(n);
for (int i = 0; i < m; ++i)
{
int u, v;
cin >> u >> v;
--u, --v;
++indeg[v];
g[u].push_back(v);
}
set<int> S;
for (int i = 0; i < n; ++i)
if (indeg[i] == 0)
S.insert(i);
int total = 0;
vector<int> ans;
while (total < n)
{
if (S.empty())
{
cout << "Sandro fails." << endl;
return 0;
}
int u = *S.begin();
S.erase(S.begin());
ans.push_back(u);
for (auto v : g[u])
if (--indeg[v] == 0)
S.insert(v);
total += 1;
}
for (auto x : ans)
cout << x+1 << " ";
cout << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxleHQvYWxnb3JpdGhtPgojaW5jbHVkZSA8ZXh0L251bWVyaWM+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp1c2luZyBuYW1lc3BhY2UgX19nbnVfY3h4OwoKI2RlZmluZSBlbmRsICdcbicKCmludCBtYWluKCkKewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKCWNpbi50aWUoMCk7CgoJaW50IG4sIG07CgljaW4gPj4gbiA+PiBtOwoKCXZlY3RvcjxpbnQ+IGluZGVnKG4pOwoJdmVjdG9yPHZlY3RvcjxpbnQ+PiBnKG4pOwoKCWZvciAoaW50IGkgPSAwOyBpIDwgbTsgKytpKQoJewoJCWludCB1LCB2OwoJCWNpbiA+PiB1ID4+IHY7CgkJLS11LCAtLXY7CgoJCSsraW5kZWdbdl07CgkJZ1t1XS5wdXNoX2JhY2sodik7Cgl9CgoJc2V0PGludD4gUzsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKQoJCWlmIChpbmRlZ1tpXSA9PSAwKQoJCQlTLmluc2VydChpKTsKCglpbnQgdG90YWw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