#include<bits/stdc++.h>usingnamespacestd;classGraph{public:intn;vector<vector<int>>adj;vector<int>indegree;Graph(intn){this->n=n;adj.resize(n);indegree.resize(n);}voidtopological_sort(){// Populate indegrees.
for(intu=0;u<n;u++){for(autochild:adj[u]){indegree[child]++;}}queue<int>q;for(inti=0;i<n;i++){if(indegree[i]==0){q.push(i);}}vector<int>res;while(!q.empty()){intnow=q.front();q.pop();res.push_back(now);for(autochild:adj[now]){indegree[child]--;if(indegree[child]==0){q.push(child);}}}// If there is a cycle, the cycle vertices would never have indegree
// zero. Hence, they'd never be processed.
if((int)res.size()!=n){cout<<"IMPOSSIBLE"<<"\n";return;}for(inti=0;i<n;i++){cout<<res[i]+1<<" ";}cout<<"\n";}};voidsolve(){intn,m;cin>>n>>m;Graphg(n);for(inti=0;i<m;i++){intx,y;cin>>x>>y;x--;y--;g.adj[x].push_back(y);}g.topological_sort();}intmain(){solve();return0;}