#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, temp1, temp2;
  scanf("%d%d", &n, &k);
  unordered_set<int> A;
  for (int i = 1; i <= n; i++) A.insert(i);
  for (int i = 0; i < k; i++) {
    scanf("%d%d", &temp1, &temp2);
    A.erase(temp1);
    A.erase(temp2);
  }
  printf("%d\n", n - 1);
  int from, to;
  from = (*(A.begin()));
  for (int i = 1; i <= n; i++) {
    if (i != from) printf("%d %d\n", from, i);
  }
  return 0;
}
