#include <bits/stdc++.h>
using namespace std;
ifstream fin("ciclueuler.in");
ofstream fout("ciclueuler.out");
const int nmax = 500005;
int n, m, st[nmax], dr[nmax], poz[nmax];
bool used[nmax];
vector < int > L[nmax], ans;
void read()
{
fin >> n >> m;
for(int i = 1; i <= m; ++i)
{
fin >> st[i] >> dr[i];
L[st[i]].push_back(i);
L[dr[i]].push_back(i);
}
}
bool euler()
{
for(int i = 1; i <= n; ++i)
if(L[i].size() & 1)
return false;
return true;
}
void dfs(int nod)
{
int x;
while(L[nod].size() > poz[nod])
{
x = L[nod][poz[nod]++];
if(!used[x])
{
used[x] = true;
dfs(st[x] + dr[x] - nod);
}
}
ans.push_back(nod);
}
void solve()
{
if(!euler())
fout << "-1\n";
else
{
dfs(1);
ans.pop_back();
for(auto it: ans)
fout << it << " ";
fout << "\n";
}
}
int main()
{
read();
solve();
return 0;
}