#include <bits/stdc++.h>
using namespace std;
ifstream fin("ciclueuler.in");
ofstream fout("ciclueuler.out");
const int nmax = 105;
vector<int> cycle;
vector<int> adj[nmax];
bool used[nmax];
int L[nmax];
int R[nmax];
int main()
{
int V, E;
fin >> V >> E;
for(int i = 1; i <= E; ++i){
int src, dst;
fin >> src >> dst;
adj[src].push_back(i);
adj[dst].push_back(i);
L[i] = src;
R[i] = dst;
}
for(int i = 1; i <= V; ++i){
if(adj[i].size() % 2)
cout << "-1\n";
return 0;
}
vector<int> cycle;
stack<int> st;
st.push(1);
while(st.size()) {
int crt = st.top();
if(adj[crt].empty()){
st.pop();
cycle.push_back(crt);
}
else {
int edgeCrt = adj[crt].back();
adj[crt].pop_back();
if(used[edgeCrt] == false){
used[edgeCrt] = true;
int to = L[edgeCrt] ^ R[edgeCrt] ^ crt;
st.push(to);
}
}
}
for(auto el: cycle)
cout << el << ' ';
cout << "asdpnfpasdnfpoansdpfnasdpfn\n";
return 0;
}