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