#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  int n1, n2, node;
  cin >> n >> m;
  vector<int> v(n + 1, 1);
  for (int i = 0; i < m; i++) {
    cin >> n1 >> n2;
    v[n1] = 0;
    v[n2] = 0;
  }
  for (int i = 1; i < n + 1; i++) {
    if (v[i] == 1) {
      node = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 0; i < n; i++) {
    if ((i + 1) != node) cout << node << " " << i + 1 << endl;
  }
  return;
}
int main() {
  int tc = 1;
  while (tc--) solve();
  return 0;
}
