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