#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> v(n + 1);
  v[0] = 1;
  for (long long i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    v[a] = 1;
    v[b] = 1;
  }
  long long mid = 1;
  for (long long i = 1; i <= n; ++i) {
    if (v[i] == 0) {
      mid = i;
      break;
    }
  }
  cout << n - 1 << '\n';
  if (n > 1) {
    for (long long i = 1; i <= n; ++i) {
      if (mid != i) cout << i << " " << mid << '\n';
    }
  }
}
