#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
using namespace std;
ifstream fin("ciclueuler.in");
ofstream fout("ciclueuler.out");
#define NMax 100010
#define MMax 500010
int n, m;
vector<int> G[NMax];
int from[MMax], to[MMax];
vector<bool> viz(MMax, false);
stack<int> s;
vector<int> rez;
void init();
void rezolvare();
int main(){
init();
rezolvare();
}
void init(){
int i, x, y;
fin >> n >> m;
for(i = 1; i <= m; i++){
fin >> x >> y;
G[x].push_back(i);
G[y].push_back(i);
from[i] = x;
to[i] = y;
}
}
void rezolvare(){
int i, x, y, e;
for(i = 1; i <= n; i++)
if(G[i].size() & 1){
fout << -1;
return;
}
s.push(1);
while(s.size()){
x = s.top();
if(G[x].size()){
e = G[x].back();
G[x].pop_back();
if(!viz[e]){
viz[e] = true;
y = to[e] ^ from[e] ^ x;
s.push(y);
}
}
else{
s.pop();
rez.push_back(x);
}
}
for(i = 0; i < rez.size() - 1; i++) fout << rez[i] << ' ';
}