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