#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  cin >> n >> m;
  std::vector<int> v(n + 1, 0);
  pair<int, int> p;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a] = 1;
    v[b] = 1;
    p.first = a;
    p.second = b;
  }
  int f = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i] == 0) {
      f = i;
      break;
    }
  }
  if (f != 0) {
    std::cout << n - 1 << std::endl;
    for (int i = 1; i <= n; i++) {
      if (i != f) std::cout << i << ' ' << f << std::endl;
    }
  } else {
    std::cout << 2 * (n - 2) << std::endl;
    for (int i = 1; i <= n; i++) {
      if (i != p.first && i != p.second) {
        std::cout << i << ' ' << p.first << std::endl;
        std::cout << i << ' ' << p.second << std::endl;
      }
    }
  }
  return 0;
}
