#include <bits/stdc++.h>
#define sz(x) int(x.size())
#define uni(x) x.resize(unique(x.begin(), x.end()) - x.begin())
#define ms(x, n) memset(x, n, sizeof(x))
#define mc(a, b) memcpy(a, b, sizeof(b))
#define tomax(a, b) a = max(a, b)
#define tomin(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f;
const int ninf = 0xc0c0c0c0;
const ll linf = 0x3f3f3f3f3f3f3f3fll;
const ll lninf = 0xc0c0c0c0c0c0c0c0ll;

int fa[3005];
vector<int> ans, append;
set<int> e[3005];

int find(int x) {
	if (fa[x] == x) return x;
	return fa[x] = find(fa[x]);
}

void dfs(int i) {
	while (!e[i].empty()) {
		int j = *e[i].begin();
		e[i].erase(j);
		e[j].erase(i);
		dfs(j);
	}
	ans.emplace_back(i);
}

int main() {
	ios::sync_with_stdio(false);
	int m, n;
	cin >> n >> m;
	for (int i = 1; i <= m; i++) {
		int x, y;
		cin >> x >> y;
		e[x].emplace(y);
		e[y].emplace(x);
	}
	int num = 0;
	for (int i = 1; i <= n; i++)
		if (sz(e[i]) % 2) num++;
	for (int i = 1; i <= n; i++) {
		int k = num;
		bool odd = sz(e[i]) % 2;
		for (auto j : e[i])
			if (sz(e[j]) % 2) {
				k--;
				if (odd) k--;
				else k++;
				odd = !odd;
			}
		if (k == 0 || (k == 2 && odd)) {
			vector<int> del;
			for (auto j : e[i])
				if (sz(e[j]) % 2) del.emplace_back(j);
			for (auto j : del) {
				e[i].erase(j);
				e[j].erase(i);
			}
			for (int j = 1; j <= n; j++) fa[j] = j;
			for (int j = 1; j <= n; j++)
				for (auto k : e[j])
					fa[find(j)] = find(k);
			vector<int> v;
			for (int j = 1; j <= n; j++)
				if (sz(e[j])) v.emplace_back(find(j));
			v.emplace_back(find(i));
			sort(v.begin(), v.end());
			uni(v);
			if (sz(v) == 1 || (sz(v) == 2 && k == 0)) {
				int add = 0;
				if (sz(v) == 2)
					for (auto j : del)
						if (sz(e[j]) && find(i) != find(j)) {
							e[i].emplace(j);
							e[j].emplace(i);
							add = j;
							break;
						}
				for (auto j : del)
					if (j != add) {
						append.emplace_back(j);
						append.emplace_back(i);
					}
				dfs(i);
				break;
			}
			else
				for (auto j : del) {
					e[i].emplace(j);
					e[j].emplace(i);
				}
		}
	}
	if (sz(append)) {
		ans.emplace_back(-1);
		for (auto i : append) ans.emplace_back(i);
	}
	cout << sz(ans) << endl;
	if (sz(ans)) {
		for (auto i : ans) cout << i << ' ';
		cout << endl;
	}
	return 0;
}
