#include <bits/stdc++.h>
using namespace std;
int main() {
  bool mark[1000];
  long long int n, k;
  cin >> n >> k;
  for (long long int i = 1; i <= 1000; i++) {
    mark[i] = false;
  }
  long long int a1, b1;
  while (k--) {
    cin >> a1 >> b1;
    mark[a1] = true;
    mark[b1] = true;
  }
  long long int i = 1;
  while (mark[i]) {
    i++;
  }
  long long int x = i;
  cout << n - 1 << endl;
  for (i = 1; i < x; i++) {
    cout << i << " " << x << endl;
  }
  for (i = x + 1; i <= n; i++) {
    cout << i << " " << x << endl;
  }
  return 0;
}
