#include<bits/stdc++.h> using namespace std; int n,e; int x,y,a[100][100]; void dfs(int x){ cout<<x<<" "; for(int j=1;j<=n;j++){ if(a[x][j]==1){ a[x][j]=0; a[j][x]=0; dfs(j); } } } int main(){ cin>>n>>e; for(int i=1;i<=e;i++){ cin>>x>>y; a[x][y]=1; a[y][x]=1; a[x][0]++; a[y][0]++; } int c=0; for(int i=1;i<=n;i++){ if(a[i][0]%2==1) c++; } if(c==0) dfs(1); else dfs(n); return 0; } /************************************************************** Problem: 2055 User: chenyongtian Language: C++ Result: Wrong Answer ****************************************************************/