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