#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, connectto;
  cin >> n >> m;
  int connected[n + 1];
  fill(connected, connected + n + 1, 0);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    connected[a] = 1;
    connected[b] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!connected[i]) connectto = i;
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++)
    if (i != connectto) cout << i << " " << connectto << endl;
  return 0;
}
