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