#include <iostream>
#include <fstream>
#include <vector>
#define Nmax 100005
using namespace std;
ifstream f("ciclueuler.in");
ofstream g("ciclueuler.out");
int n, m, x, y;
vector <pair<int, int> > v[Nmax];
vector <int> ans;
bool seen[Nmax];
void euler(int x)
{
while(v[x].size())
{
int y = v[x].back().first;
int edg=v[x].back().second;
v[x].pop_back();
if(seen[edg] == 1) continue;
seen[edg]=1;
euler(y);
}
ans.push_back(x);
}
int main()
{
f >> n >> m;
for (int i = 1; i <= m; i++)
{
f >> x >> y;
v[x].push_back({y, i});
v[y].push_back({x, i});
}
for (int i = 1; i <= n; i++)
if(v[i].size()%2 == 1)
{
g << "-1";
return 0;
}
euler(1);
for (int i = 0, l=ans.size(); i < l; i++)
g << ans[i] << " ";
return 0;
}