#include <fstream>
#include <list>
#include <algorithm>
using namespace std;
ifstream f("ciclueuler.in");
ofstream g("ciclueuler.out");
const int N = 100005;
int n, m, x, y, i;
list <int> ls[N];
int stiva[20*N], vf;
int main() {
f >> n >> m;
while (m--) {
f >> x >> y;
ls[x].push_back(y);
ls[y].push_back(x);
}
for (i = 1; i <= n; i++)
if (ls[i].size()%2) {
g << -1;
return 0;
}
stiva[vf=1] = 1;
while (vf > 0) {
x = stiva[vf];
while (ls[x].empty() == 0) {
y = ls[x].front();
ls[x].pop_front();
ls[y].erase( find(ls[y].begin(), ls[y].end(), x) );
stiva[++vf] = y;
x = y;
}
g << stiva[vf--] << ' ';
}
}