#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN = 7001;
vector<int> g[MAXN];
vector<pair<int, int>> ans1, ans2;
bool vis[MAXN];
void dfs(int u) {
vis[u] = true;
for (int v : g[u]) {
if (!vis[v]) {
dfs(v);
ans1.emplace_back(u, v);
}
}
}
void print_ans() {
int k = ans1.size() + ans2.size();
cout << k << "\n";
for (auto [u, v] : ans1) {
cout << u << " " << v << "\n";
}
for (auto [u, v] : ans2) {
cout << u << " " << v << "\n";
}
}
void case1() {
dfs(1);
ans2 = ans1;
ans2.pop_back();
reverse(ans2.begin(), ans2.end());
print_ans();
exit(0);
}
void case2(vector<int> cyc) {
for (int i : cyc) vis[i] = true;
for (int i : cyc) {
dfs(i);
}
ans2 = ans1;
ans1.emplace_back(cyc[0], cyc[1]);
ans1.emplace_back(cyc[2], cyc[3]);
ans1.emplace_back(cyc[0], cyc[3]);
ans1.emplace_back(cyc[1], cyc[2]);
reverse(ans2.begin(), ans2.end());
print_ans();
exit(0);
}
vector<int> mp[MAXN];
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin >> n >> m;
if (n == 1) {
cout << "0\n";
return 0;
}
for (int i = 0; i < m; i++) {
int u, v; cin >> u >> v;
g[u].emplace_back(v);
g[v].emplace_back(u);
}
for (int i = 1; i <= n; i++) {
for (int u : g[i]) {
for (int v : g[u]) {
mp[v].emplace_back(u);
}
}
for (int u = 1; u <= n; u++) {
if (u == i) continue;
if (mp[u].size() >= 2) {
case2({i, mp[u][0], u, mp[u][1]});
}
}
for (int u = 1; u <= n; u++) {
mp[u].clear();
}
}
case1();
return 0;
}