#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, all;
  map<int, int> mp;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    mp[x] = 1;
    mp[y] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (!mp[i]) {
      all = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; ++i) {
    if (i == all) continue;
    cout << all << " " << i << endl;
  }
  return 0;
}
