#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int n, m, f[10000];
int main() {
  scanf("%d %d", &n, &m);
  while (m--) {
    int u, v;
    scanf("%d %d", &u, &v);
    f[u] = f[v] = 1;
  }
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++) {
    if (f[i]) continue;
    for (int a = 1; a <= n; a++)
      if (a != i) printf("%d %d\n", i, a);
    return 0;
  }
  return 0;
}
