#include <bits/stdc++.h>
using namespace std;
ifstream f("ciclueuler.in");
ofstream g("ciclueuler.out");
const int NMAX = 100005;
int poz;
vector <int> G[NMAX];
list <int> Q;
int n, x, y, m, nr;
std::vector<int>::iterator low;
int main()
{
f>>n>>m;
for(int i=1; i<=m; i++) {
f>>x>>y;
G[x].push_back(y);
G[y].push_back(x);
}
bool ok=true;
for(int i=1; i<=n; i++)
if(G[i].size()%2==1) {
ok=false;
break;
}
for(int i=1; i<=n; i++)
sort(G[i].begin(), G[i].end());
if(ok==true) {
Q.push_back(1);
nr++;
while(!Q.empty()) {
x=Q.front();
if(!G[x].size() ) {
if(nr<=m)
g<<x<<' ', nr++;
Q.pop_front();
}
else {
y=G[x].back();
Q.push_front(y);
G[x].pop_back();
low=std::lower_bound (G[y].begin(), G[y].end(), x);
G[y].erase(G[y].begin() + (low-G[y].begin()));
}
}
}
else g<<-1;
g<<'\n';
return 0;
}