#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[1000], b[1000];
  cin >> n >> m;
  bool centre[1000] = {0};
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    centre[a[i]] = true;
    centre[b[i]] = true;
  }
  int no;
  for (int i = 1; i <= n; i++) {
    if (centre[i] == false) {
      no = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i == no)
      continue;
    else {
      cout << no << " " << i << endl;
    }
  }
}
