#include <bits/stdc++.h>
bool chk[1001];
int main() {
  int n, m, a, b;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    chk[a] = true;
    chk[b] = true;
  }
  int index = 1;
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++) {
    if (chk[i] == false) {
      index = i;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != index) {
      printf("%d %d\n", index, i);
    }
  }
  return 0;
}
