#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y;
  cin >> n >> m;
  bool *a = new bool[n + 1];
  for (int i = 1; i <= n; ++i) {
    a[i] = true;
  }
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    a[x] = false;
    a[y] = false;
  }
  int i = 1;
  for (; i <= n; ++i) {
    if (a[i]) break;
  }
  cout << n - 1 << endl;
  for (int j = 1; j <= n; ++j) {
    if (j == i) continue;
    cout << i << " " << j << endl;
  }
  return 0;
}
