#include <bits/stdc++.h>
using namespace std;
int f[1010] = {0};
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    f[a] = f[b] = 1;
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (f[i] == 0) {
      for (int j = 1; j <= n; j++) {
        if (i == j) continue;
        printf("%d %d\n", i, j);
      }
      break;
    }
  }
  return 0;
}
