#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main() {
  int n, m, x, y, r = -1;
  cin >> n >> m;
  while (m--) {
    cin >> x >> y;
    a[x] = 1;
    a[y] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      r = i;
      break;
    }
  }
  cout << n - 1 << endl;
  m = n;
  while (m) {
    if (m != r) cout << m << " " << r << endl;
    m--;
  }
}
