#include <bits/stdc++.h>
using namespace std;
int main() {
  int wanted = 0, cities0, cities1;
  bool city[1000] = {false};
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> cities0 >> cities1;
    city[cities0 - 1] = true;
    city[cities1 - 1] = true;
  }
  for (int i = 0; i < n; i++) {
    if (city[i] == false) {
      wanted = i + 1;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i != wanted) {
      cout << i << " " << wanted << endl;
    }
  }
  return 0;
}
