#include <bits/stdc++.h>
using namespace std;

const int maxn = 2e5 + 10;

int n, m, u, v, dgr[maxn];

struct Edge {int to, vis, nex;} edge[maxn << 1];
int head[maxn], cur[maxn], ecnt = 1;
void add_edge (int u, int v)
{
    dgr[u]++, dgr[v]++;
    edge[++ecnt] = {v, 0, head[u]}; head[u] = ecnt;
    edge[++ecnt] = {u, 0, head[v]}; head[v] = ecnt;
}
vector<int> stk;
void eularian (int u)
{
    for (int &i = cur[u]; i; i = edge[i].nex)
    {
        if (edge[i].vis) continue;
        edge[i].vis = edge[i ^ 1].vis = 1;
        int temp = i;
        eularian (edge[i].to);
        stk.push_back (temp);
    }
}
void solve (int u)
{
    stk.clear();
    int odd = 0;
    for (int i = 1; i <= n; i++) odd += (dgr[i] & 1);
    if (odd > 2 || ((odd == 2) && !(dgr[u] & 1)))
    {
        for (int i = 1; i <= n; i++) cur[i] = head[i];
        for (int i = 1; i <= ecnt; i++) edge[i].vis = 0;
        return ;
    }
    int v = u;
    if (odd == 2) for (int i = 1; i <= n; i++) if (i != u && dgr[i] & 1) v = i;
    eularian (v);
    reverse (stk.begin(), stk.end());
    for (int i = 1; i <= n; i++) cur[i] = head[i];
    for (int i = 1; i <= ecnt; i++) edge[i].vis = 0;
}
vector<int> vc, ans;
void print (int u)
{
    if (!stk.empty ())
    {
        ans.push_back (edge[stk[0] ^ 1].to);
        for (auto it : stk) ans.push_back (edge[it].to);
    }
    else ans.push_back (u);
    ans.push_back (-1);
    for (auto it : vc) ans.push_back (it), ans.push_back (u);
    printf ("%d\n", ans.size());
    for (auto it : ans) printf ("%d ", it); puts ("");
}

int main()
{
    scanf ("%d %d", &n, &m);
    for (int i = 1; i <= m; i++)
    {
        scanf ("%d %d", &u, &v);
        add_edge (u, v);
    }
    for (int i = 1; i <= n; i++) cur[i] = head[i];
    int odd = 0;
    for (int i = 1; i <= n; i++) odd += (dgr[i] & 1);
    if (odd <= 2)
    {
        int u = 1;
        if (odd == 2)
        {
            for (int i = 1; i <= n; i++) if (dgr[i] & 1) add_edge (i, n + 1);
            u = n + 1;
            for (int i = 1; i <= u; i++) cur[i] = head[i];
        }
        eularian (u);
        reverse (stk.begin(), stk.end());
        printf ("%d\n", m + 1);
        if (u <= n) printf ("%d ", u);
        for (auto it : stk) if (edge[it].to <= n) printf ("%d ", edge[it].to);
        puts ("");
        return 0;
    }
    for (int u = 1; u <= n; u ++)
    {
        vc.clear ();
        for (int i = cur[u]; i; i = edge[i].nex)
        {
            int v = edge[i].to;
            if (dgr[v] & 1)
            {
                dgr[u]--, dgr[v]--;
                vc.push_back (v);
                edge[i].vis = edge[i ^ 1].vis = 1;
            }
        }
        solve (u);
        for (auto v : vc) dgr[u]++, dgr[v]++;
        if ((int)stk.size() + (int)vc.size() == m)
        {
            print (u);
            return 0;
        }
        for (int t = 0; t < vc.size(); t++)
        {
            for (int i = cur[u]; i; i = edge[i].nex)
            {
                int v = edge[i].to;
                if (v != vc[t] && (dgr[v] & 1))
                {
                    dgr[u]--, dgr[v]--;
                    edge[i].vis = edge[i ^ 1].vis = 1;
                }
            }
            solve (u);
            for (auto v : vc) if (v != vc[t]) dgr[u]++, dgr[v]++;
            if ((int)stk.size() + (int)vc.size() == m + 1)
            {
                vc.erase (vc.begin() + t);
                print (u);
                return 0;
            }
        }
    }
    puts ("0");
	return 0;
}
