#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  unordered_set<int> s;
  for (int i = 0; i < m; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    s.insert(t1);
    s.insert(t2);
  }
  int nc = 0;
  for (int i = 1; i <= n; i++) {
    if (s.find(i) == s.end()) {
      nc = i;
      break;
    }
  }
  cout << n - 1 << '\n';
  for (int i = 1; i <= n; i++) {
    if (i != nc) {
      cout << i << " " << nc << '\n';
    }
  }
  return 0;
}
