include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
const int N=100010,M=100010;
int n,m;
bool st[N];
int g[N][N];
struct node{
int val;
node next;
node(int x) : val(x) ,next(NULL) {}
}head[N];
void add(int a,int b){
auto p = new node(b);
p->next=head[a];
head[a]=p;
}
void dfs(int u){
st[u]=true;
cout<[HTML_REMOVED]next)
{
int j = p->val;
if(!st[j]) dfs(j);
}
}
int main(){
cin>>n>>m;
while(m–){
int a,b;
cin>>a>>b;
add(a,b);
}
for(int i=1;i<=n;i++){
if(!st[i] ) dfs(i);
}
}