#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b;
  bool f[1002] = {false};
  cin >> n >> m;
  while (m--) {
    cin >> a >> b;
    f[a] = true;
    f[b] = true;
  }
  int x = 1;
  while (f[x]) x++;
  cout << n - 1 << endl;
  for (int i = 1; i < x; ++i) {
    cout << i << " " << x << endl;
  }
  for (int i = x + 1; i <= n; ++i) {
    cout << x << " " << i << endl;
  }
}
