#include <fstream>
#include <vector>
using namespace std;
ifstream cin ("ciclueuler.in");
ofstream cout ("ciclueuler.out");
vector<pair<int,int> > g[100005];
vector<int> rasp;
int d[100005];
bool u[100005];
bool muchii[500005];
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);
int n,m;
cin >> n >> m;
for(int i=1;i<=m;i++)
{
int a,b;
cin >> a >> b;
g[a].push_back({b,i});
g[b].push_back({a,i});
d[a]++;
d[b]++;
}
for(int i=1;i<=n;i++)
{
if(d[i]%2!=0)
{
cout << "-1" << '\n';
return 0;
}
}
dfs(1);
for(int i=1;i<=n;i++)
{
if(u[i])
continue;
cout << "-1";
return 0;
}
vector<int> st;
st.push_back(1);
while(!st.empty())
{
int vf = st.back();
if(g[vf].empty())
{
st.pop_back();
rasp.push_back(vf);
continue;
}
pair<int,int> muchie = g[vf].back();
g[vf].pop_back();
if(muchii[muchie.second])
continue;
st.push_back(muchie.first);
muchii[muchie.second] = true;
}
rasp.pop_back();
for(auto x:rasp)
cout << x << ' ';
return 0;
}