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