#include <bits/stdc++.h>
using namespace std;
const int NMAX=1e5+5;
vector<int>lstrez;
vector<int>lst[NMAX];
int grd[NMAX];
struct cows
{
int x,y;
};
cows mch[NMAX*5];
bool vf[NMAX];
bool vf2[NMAX*5];
int cont=0;
void Dfs(int poz)
{
cont++;
vf[poz]=true;
for(auto i:lst[poz])
{
int i2;
if(mch[i].x!=poz)
i2=mch[i].x;
else
i2=mch[i].y;
if(vf[i2]==false)
{
Dfs(i2);
}
}
}
void Dfs2(int poz)
{
for(int i=0;i<lst[poz].size();i++)
{
int y=i;
int i2;
if(mch[i].x!=poz)
i2=mch[i].x;
else
i2=mch[i].y;
swap(lst[poz][i],lst[poz][lst[poz].size()-1]);
lst[poz].pop_back();
if(vf2[y]==false)
{
vf2[y]=true;
Dfs2(i2);
}
}
lstrez.push_back(poz);
}
int main()
{
ifstream cin("ciclueuler.in");
ofstream cout("ciclueuler.out");
int n,m;
cin>>n>>m;
for(int i=1;i<=m;i++)
{
int a,b;
cin>>mch[i].x>>mch[i].y;
lst[mch[i].x].push_back(i);
lst[mch[i].y].push_back(i);
grd[mch[i].x]++;
grd[mch[i].y]++;
}
for(int i=1;i<=n;i++)
{
if(grd[i]%2!=0)
{
cout<<-1;
return 0;
}
}
Dfs(1);
if(cont!=n)
{
cout<<-1;
return 0;
}
Dfs2(1);
reverse(lstrez.begin(),lstrez.end());
lstrez.pop_back();
for(auto i:lstrez)
cout<<i<<" ";
return 0;
}