#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[1010] = {};
  int j, k;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &j, &k);
    a[j - 1] = 1;
    a[k - 1] = 1;
  }
  int mid = -1;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      mid = i + 1;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i < n + 1; i++) {
    if (i != mid) {
      printf("%d %d\n", mid, i);
    }
  }
  return 0;
}
