#include <bits/stdc++.h>
int main() {
  int n, c, i, x, y, centre;
  scanf("%d %d", &n, &c);
  int a[n + 1];
  for (i = 1; i <= n; i++) a[i] = 0;
  for (i = 1; i <= c; i++) {
    scanf("%d %d", &x, &y);
    a[x] = 1;
    a[y] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (a[i] == 0) {
      centre = i;
      break;
    }
  }
  printf("%d\n", n - 1);
  for (i = 1; i <= n; i++) {
    if (i == centre)
      continue;
    else
      printf("%d %d\n", centre, i);
  }
  return 0;
}
