#include <bits/stdc++.h>
using namespace std;
int n, m;
bool reachable(vector<set<int>> g, int u, int v) {
  if (g[u].find(v) == g[u].end()) {
    for (auto x : g[u]) {
      if (g[x].find(v) != g[x].end()) return true;
    }
  } else {
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  set<pair<int, int>> edges;
  set<int> badnodes;
  while (m--) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    edges.insert({x, y});
    edges.insert({y, x});
    badnodes.insert(x);
    badnodes.insert(y);
  }
  int c = 0;
  for (int u = 0; u < n; ++u) {
    if (badnodes.find(u) == badnodes.end()) c = u;
  }
  cout << n - 1 << endl;
  vector<set<int>> g(n);
  for (int u = 0; u < n; ++u) {
    if (u == c) continue;
    if (reachable(g, u, c)) continue;
    if (edges.find({u, c}) == edges.end()) {
      g[c].insert(u);
      g[u].insert(c);
      cout << c + 1 << ' ' << u + 1 << endl;
    } else {
      for (int v = 0; v < n; ++v) {
        if (edges.find({u, v}) == edges.end()) {
          g[u].insert(v);
          g[v].insert(u);
          cout << u + 1 << ' ' << v + 1 << endl;
        }
      }
    }
  }
  return 0;
}
