Problem: You are given an undirected connected graph consisting of n vertices and m edges. Your goal is to destroy all edges of the given graph.

You may choose any vertex as the starting one and begin walking from it along the edges. When you walk along an edge, you destroy it. Obviously, you cannot walk along an edge if it is destroyed.

You can perform the mode shift operation at most once during your walk, and this operation can only be performed when you are at some vertex (you cannot perform it while traversing an edge). After the mode shift, the edges you go through are deleted in the following way: the first edge after the mode shift is not destroyed, the second one is destroyed, the third one is not destroyed, the fourth one is destroyed, and so on. You cannot switch back to the original mode, and you don't have to perform this operation if you don't want to.

Can you destroy all the edges of the given graph?

Input

The first line contains two integers n and m (2 ≤ n ≤ 3000; n - 1 ≤ m ≤ min((n(n-1))/(2), 3000)) — the numbef of vertices and the number of edges in the graph.

Then m lines follow, each containing two integers x_i and y_i (1 ≤ x_i, y_i ≤ n; x_i ≠ y_i) — the endpoints of the i-th edge. 

These edges form a connected undirected graph without multiple edges.

Output

If it's impossible to destroy all of the edges, print 0.

Otherwise, print the sequence of your actions as follows. First, print k — the number of actions (k ≤ 2m + 2). Then, print the sequence itself, consisting of k integers. The first integer should be the index of the starting vertex. Then, each of the next integers should be either the index of the next vertex in your traversal, or -1 if you use mode shift. You are allowed to use mode shift at most once.

If there are multiple answers, print any of them.

Examples

Input


3 3
1 2
2 3
3 1


Output


4
1 2 3 1


Input


4 3
1 2
2 3
4 2


Output


8
2 -1 1 2 3 2 4 2 


Input


5 5
1 2
2 3
3 1
2 4
2 5


Output


9
2 3 1 2 -1 4 2 5 2 


Input


5 5
1 2
2 3
3 1
2 4
4 5


Output


8
5 4 2 3 1 -1 2 1 


Input


6 5
1 2
2 3
3 4
4 5
3 6


Output


0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define Unique(v) sort(all(v));v.erase(unique(all(v)),v.end());
#define sz(v) ((int)v.size())
//#define int long long  
using namespace std;
typedef vector<int> vi;
#define y1 abacaba
//#define left oooooopss
#define db(x) cerr << #x <<" == "<<x << endl;
#define db2(x,y) cerr<<#x <<" == "<<x<<", "<<#y<<" == "<<y<<endl;
#define db3(x,y,z) cerr << #x<<" == "<<x<<", "<<#y<<" == "<<y<<", "<<#z<<" == "<<z<<endl;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
inline ll mod(ll n, ll m ){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll b,ll e,ll m){
  b%=m;
  ll ans = 1;
  for (; e; b = b * b % m, e /= 2)
      if (e & 1) ans = ans * b % m;
  return ans;
}




class EulerTour{  
public:
  vi tour , tour_e;
  EulerTour() = default;
  EulerTour(int _n , bool _directed){ 
    dg.assign(_n+1,0);
    g = vector< vector<pii> >(_n+1);
    directed = _directed;
  }
  void addEdge(int a, int b){
    int id = sz(del);
    g[a].push_back({b,id});
    del.push_back(0);
    dg[a]++;
    if(!directed){
      g[b].push_back({a,id});
      del.push_back(0);
      dg[b]++;
    }
  }
  void find(int start){
      vector<int> pilha = {start};
      while(sz(pilha)){
          int x = pilha.back();
          while(sz(g[x]) and del[g[x].back().second]){
              dg[x]--;
              g[x].pop_back();
          }
          if(!dg[x]){
              tour.push_back(x);   // tour_e.push_back(x.second) ;
              pilha.pop_back();
              continue;
          }
          auto v = g[x].back();
          g[x].pop_back();
          dg[x] -- , del[v.second] = true;
          pilha.push_back(v.first);       // pilha.push_back(v)
      }   
  }
private:
  vi dg , del;
  vector< vector<pii> > g;
  bool directed = false;
};

const int N= 3030;
vi g[N];
int deg[N];
int n,m;
pii e[N];
int star[N];

struct dsu{
  vi p , ps;
  dsu(int n){
    p = vi(n+1),ps = vi(n+1,1);
    rep(i,0,n+1) p[i] = i;
  }
  int find(int x){return p[x]==x?x:p[x]=find(p[x]);}
  bool join(int x , int y){
    x = find(x) , y = find(y);
    if(x == y) return 0;
    if(ps[x] > ps[y]) swap(x,y);
    p[x] = y, ps[y] += ps[x];
    return 1;
  }
};  
int foi[N];

void solve(int root){

  rep(i,1,n+1)deg[i] = 0,star[i]=0,foi[i] = 0;
  EulerTour E(n,0);
  int edges=0;
  dsu D(n);
  int comp = n;
  vector<pii> ed;
  rep(i,0,m){
    if(e[i].ff==root || e[i].ss==root)continue;
    deg[e[i].ff]++;
    deg[e[i].ss]++;
    E.addEdge(e[i].ff,e[i].ss);
    edges++;
    if(D.join(e[i].ff,e[i].ss))comp--;
    ed.pb(e[i]);
  }

  for(int v : g[root]){
    if(sz(g[v])==1){
      star[v] = 1;
      if(D.join(v,root))
          comp--;
    }else{
      if(deg[v]&1){
        deg[v]++;
        deg[root]++;
        foi[v] = 1;
        ed.pb(pii(v,root));
        E.addEdge(root,v);
        if(D.join(v,root))
          comp--;
      }else star[v] = 1;
    }
  }

  int odd = 0;
  int id = root;
  rep(i,1,n+1){
    if(deg[i]&1){
      odd++;
      if(i!=root)id = i;
    }
  }
  if(odd > 2)return;
  if(comp == 1 and ((edges == 0) || (odd == 2 and (deg[root]&1)) || (odd==0 and deg[root]>0))){
    E.find(id);

    vi res = E.tour;

    reverse(all(res));
    res.pb(-1);
    rep(i,1,n+1)if(star[i]){
      res.pb(i);
      res.pb(root);
    }
    cout << sz(res) << endl;
    for(int x : res)cout << x<<" ";
    cout << endl;
    exit(0);
  }

  if(comp > 2)return;
  if(odd==2)return;

  for(int v : g[root]){
    if(sz(g[v])==1)continue;
    if(comp == 2 and D.find(v)==D.find(root))continue;
    assert(deg[v]%2==0);
    deg[root]++;
    deg[v]++;

    if(foi[v]){
      E = EulerTour(n,0);
      for(auto it : ed){
        if(it.ff!=v || it.ss!=root){
          E.addEdge(it.ff,it.ss);
        }
      }
      star[v] = 1;
      
    }else E.addEdge(v,root),star[v]=0;


    int id = v;

    E.find(id);
    vi res = E.tour;
    reverse(all(res));
    res.pb(-1);
    rep(i,1,n+1)if(star[i]){

      res.pb(i);
      res.pb(root);
    }
    cout << sz(res) << endl;
    for(int x : res)cout << x<<" ";
    cout << endl;
    exit(0);


  }


}

int32_t main(){
  fastio;
  cin >> n >> m;
  EulerTour E(n,0);

  rep(i,0,m){
    int a,b;
    cin >> a >> b;
    g[a].pb(b);
    g[b].pb(a);
    deg[a]++;
    deg[b]++;
    e[i] = pii(a,b);
    E.addEdge(a,b);
  }
  int odd = 0;
  int id = 1;
  rep(i,1,n+1){
    if(deg[i]&1){
      id = i,odd++;
    }
  }
  if(odd==0 || odd == 2){
    E.find(id);
    vi res = E.tour;
    cout << sz(res) << endl;
    for(int x : res)cout << x<<" ";
    cout << endl;
    exit(0);
  }
  for(int i=1;i<=n;i++){
    solve(i);
  }
  cout<<"0\n";
  return 0;

  // math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}