#include <fstream>
#include <vector>
using namespace std;
ifstream cin ("ciclueuler.in");
ofstream cout ("ciclueuler.out");
int n,m;
vector< pair<int,int> > g[100005];
int d[100005];
bool u[400005];
vector<int> rasp;
void dfs(int nod)
{
u[nod] = true;
for(auto urm:g[nod])
{
if(u[urm.first])
continue;
dfs(urm.first);
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for(int i=1;i<=m;i++)
{
int x,y;
cin >> x >> y;
g[x].push_back({y,i});
g[y].push_back({x,i});
d[x]++;
d[y]++;
}
dfs(1);
for(int i=1;i<=n;i++)
{
if(d[i]%2!=0 || !u[i])
{
cout << "-1";
return 0;
}
}
for(int i=1;i<=m;i++)
u[i] = false;
//rasp.push_back(1);
vector<int> st;
st.push_back(1);
while(!st.empty())
{
int vf = st.back();
int urm = -1;
if(g[vf].empty())
{
st.pop_back();
rasp.push_back(vf);
continue;
}
pair<int,int> muchie = g[vf].back();
g[vf].pop_back();
if(u[muchie.second])
continue;
st.push_back(muchie.first);
u[muchie.second] = true;
}
rasp.pop_back();
for(auto x:rasp)
cout << x << ' ';
return 0;
}