#define_CRT_SECURE_NO_WARNINGS#include<iostream>#include<cstdio>usingnamespace std;bool g[1010][1010];int c[1000010];int n, m;int pos =0;int a[1000010];voiddfs(int x){for(int i =1; i <= n; i ++){if(g[x][i]==true){
g[x][i]= g[i][x]=false;dfs(i);}}
a[++ pos]= x;}voidprint(int x){if(x == pos +1){return;}printf("%d ", a[x]);print(x +1);}intmain(){scanf("%d%d",&n,&m);for(int i =1; i <= m; i ++){int x, y;scanf("%d%d",&x,&y);
g[x][y]= g[y][x]=true;
c[x]++;
c[y]++;}int AC =1;for(int i =1; i <= n; i ++){if(c[i]%2==1){
AC = i;break;}}dfs(AC);print(1);return0;}