#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> toUse;
  for (int i = 1; i <= n; i++) toUse.insert(i);
  int ai, bi;
  while (m--) {
    cin >> ai >> bi;
    toUse.erase(ai);
    toUse.erase(bi);
  }
  set<int>::const_iterator i = toUse.begin();
  cout << n - 1 << endl;
  for (int k = 1; k <= n; k++) {
    if (*i != k) cout << *i << " " << k << endl;
  }
  return 0;
}
