#include <bits/stdc++.h>
using namespace std;
int a[1001];
int main() {
  int n, m, i, j, x, y;
  cin >> n >> m;
  while (m--) {
    cin >> x >> y;
    a[x] = 1;
    a[y] = 1;
  }
  for (i = 1; i <= n; i++)
    if (a[i] == 0) break;
  printf("%d\n", n - 1);
  for (j = 1; j <= n; j++) {
    if (i == j) continue;
    printf("%d %d\n", i, j);
  }
  return 0;
}
