#include <bits/stdc++.h>
int map[1100];
int main() {
  int i, k, n, m, a, b;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(map, 0, sizeof(map));
    for (i = 0; i < m; i++) {
      scanf("%d%d", &a, &b);
      map[a] = 1;
      map[b] = 1;
    }
    for (i = 1; i <= n; i++)
      if (map[i] == 0) k = i;
    printf("%d\n", n - 1);
    for (i = 1; i <= n; i++)
      if (k != i) printf("%d %d\n", k, i);
  }
  return 0;
}
