#include <bits/stdc++.h>
using namespace std;
vector<long long> vec;
vector<pair<int, int> > vp;
pair<int, int> ar[600005];
int no[5000];
int main() {
  int n, m, q, w;
  cin >> n >> m;
  for (int i = 1; i < n + 1; i++) {
    cin >> q >> w;
    no[q] = 1, no[w] = 1;
  }
  cout << n - 1 << endl;
  for (int i = 1; i < n + 1; i++) {
    if (no[i] == 0) {
      for (int j = 1; j < n + 1; j++) {
        if (i == j) continue;
        cout << i << ' ' << j << endl;
      }
      return 0;
    }
  }
}
