#include<cstdio>#include<vector>#include<stack>#include<algorithm>usingnamespace std;
vector<vector<int>> G;
vector<int> Indegree, Ans;intTopological(int N ){
stack<int> s;int cnt =0, v;for(int i =0; i < N;++i )if(!Indegree[i])
s.push(i);while(!s.empty()){
v = s.top();++cnt;
Ans.push_back( v );
s.pop();for(int i =0; i < G[v].size();++i )if(!(--Indegree[ G[v][i]]))
s.push( G[v][i]);}}intmain(){int N, M, a, b;scanf("%d %d",&N,&M);
Indegree.resize(N);
G.resize(N);for(int i =0; i < M;++i ){scanf("%d %d",&a,&b);
G[a].push_back(b);++Indegree[b];}Topological( N );if( Ans.size()== N )for(int i =0; i < Ans.size();++i )printf("%d%s", Ans[i], i == Ans.size()-1?"":" ");elseprintf("No TopologicalSort Sequence!");}