#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  while (cin >> N >> M) {
    bool Condid[1001];
    int i, j, a, b, Top;
    memset(Condid, true, sizeof(Condid));
    if (N == 1) {
      cout << 0 << endl << endl;
      break;
    }
    while (M--) {
      cin >> a >> b;
      Condid[a] = false;
      Condid[b] = false;
    }
    for (i = 1; i <= N; i++) {
      if (Condid[i]) {
        Top = i;
        break;
      }
    }
    cout << N - 1 << endl;
    for (i = 1; i <= N; i++) {
      if (Top != i) cout << i << ' ' << Top << endl;
    }
  }
}
