#include <cstdio>
#include <vector>
#include <bitset>
#include <cctype>
#include <stack>
#define N 100005
#define M 500005
#define BUFF_SIZE 4096
using namespace std;
FILE *f = fopen("ciclueuler.in", "r");
FILE *g = fopen("ciclueuler.out", "w");
char buff[BUFF_SIZE];
int pos = BUFF_SIZE;
inline char getChar()
{
if(pos == BUFF_SIZE)
{
fread(buff, 1, BUFF_SIZE, f);
pos = 0;
}
return buff[pos++];
}
inline int READ_INT()
{
int result = 0;
char c;
do{
c = getChar();
} while(!isdigit(c));
do
{
result = result * 10 + (c - '0');
c = getChar();
} while(isdigit(c));
return result;
}
struct muchie
{
int st, dr;
} v[M];
int n;
vector <int> G[N];
bitset <M> viz;
stack <int> s;
bool e_pe_ciclu()
{
for(int i = 1; i <= n; ++i)
if(G[i].size() % 2 == 1) return 0;
return 1;
}
int main()
{
int m;
n = READ_INT(); m = READ_INT();
for(int i = 1; i <= m; ++i)
{
v[i].st = READ_INT(); v[i].dr = READ_INT();
G[ v[i].st ].push_back(i);
G[ v[i].dr ].push_back(i);
}
fclose(f);
int nod, mch;
if(e_pe_ciclu())
{
s.push(1);
while(!s.empty())
{
nod = s.top();
if(G[nod].empty())
{
if(s.size() > 1) fprintf(g, "%d ", nod);
s.pop();
}
else
{
mch = G[nod].back();
G[nod].pop_back();
if(!viz[mch])
{
viz[mch] = 1;
if(nod == v[mch].st) nod = v[mch].dr;
else nod = v[mch].st;
s.push(nod);
}
}
}
}
else fprintf(g, "-1");
fclose(g);
return 0;
}