#include <bits/stdc++.h>
using namespace std;
const int MAX = 200005;
const int inf = 1 << 30;
int flag[MAX];
int main() {
  int i, j, n, m;
  int u, v;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(flag, 0, sizeof(flag));
    for (i = 1; i <= m; i++) {
      scanf("%d%d", &u, &v);
      flag[u] = flag[v] = 1;
    }
    for (i = 1; i <= n; i++)
      if (flag[i] == 0) j = i;
    cout << n - 1 << endl;
    for (i = 1; i <= n; i++)
      if (i != j) printf("%d %d\n", i, j);
  }
  return 0;
}
