#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
FILE *in,*out;
const int nmax = 100000;
const int mmax = 500000;
struct Edge
{
int from;
int to;
bool del;
};
Edge e[1 + mmax];
vector <int> g[1 + nmax]; //g[i][0] = indicele unei muchii incidente in nodul i
int n, m, nc;
int cc[1 + nmax];
void bfs(int start)
{
queue <int> q;
q.push(start);
while(0 < q.size())
{
int from = q.front();
q.pop();
for(int i = 0; i < g[from].size(); i++)
{
int pedge = g[from][i];
int to = e[pedge].to;
if(to == from)
to = e[pedge].from;
if(cc[to] == 0)
{
cc[to] = nc;
q.push(to);
}
}
}
}
stack<int> st1, st2;
void euler(int from)
{
if(0 < g[from].size())
{
int pedge = g[from].back(); //imi returneaza ultimul element din vector
g[from].pop_back();
if(e[pedge].del == 0)
{
int to = e[pedge].to;
if(to == from)
to = e[pedge].from;
e[pedge].del = 1;
//st1.push(to);
euler(to);
}
euler(from);
}
else
{
st2.push(from);
}
}
void euleriterativ()
{
while(st1.size() > 0)
{
int from = st1.top();
//st1.pop();
if(0 < g[from].size())
{
int pedge = g[from].back(); //imi returneaza ultimul element din vector
g[from].pop_back();
if(e[pedge].del == 0)
{
int to = e[pedge].to;
if(to == from)
to = e[pedge].from;
e[pedge].del = 1;
//euler(to);
st1.push(to);
}
//euler(from);
//st1.push(from);
}
else
{
st2.push(from);
st1.pop();
}
}
}
int main()
{
int start;
in = fopen("ciclueuler.in","r");
out = fopen("ciclueuler.out","w");
fscanf(in, "%d %d", &n, &m);
for(int i = 1; i <= m; i ++)
{
fscanf(in,"%d %d", &e[i].from, &e[i].to);
e[i].del = 0;
g[e[i].from].push_back(i);
g[e[i].to].push_back(i);
}
bool flag = 0; //verifica paritatea gradelor
for(int i = 1; i <= n; i++)
{
if(0 < g[i].size() && cc[i] == 0)
{
start = i;
nc++;
cc[i] = nc;
bfs(i);
}
if(g[i].size() % 2 == 1)
flag = 1;
}
if(nc <= 1 && flag == 0)
{
for(int i=1; i<=n; i++)
{
//cout<<i<<" -> ";
for(int j=0; j<g[i].size(); j++)
{
int pedge = g[i][j];
int to = e[pedge].to;
if(to == i)
to = e[pedge].from;
// cout<<to<<" ";
}
//cout<<endl;
}
//cout<<endl;
st1.push(start);
euleriterativ();
while(st2.size() > 0)
{
fprintf(out,"%d ",st2.top());
st2.pop();
}
}
else
{
fprintf(out, "-1");
}
return 0;
}