#include <bits/stdc++.h>
using namespace std;
int N, M, u, v;
bool which[1000 + 5];
int main() {
  memset(which, true, sizeof which);
  cin >> N >> M;
  while (M--) {
    cin >> u >> v;
    which[u - 1] = which[v - 1] = false;
  }
  int pos = 0;
  while (!which[pos]) pos++;
  cout << N - 1 << endl;
  for (int i = 0; i < N; i++)
    if (pos != i) cout << i + 1 << " " << pos + 1 << endl;
  return 0;
}
