#include <bits/stdc++.h>
using namespace std;
bool found(vector<int> no, int val) {
  int e = no.size() - 1, s = 0;
  while (s <= e) {
    int mid = s + ((e - s) / 2);
    if (no[mid] == val)
      return true;
    else if (no[mid] > val)
      e = mid - 1;
    else if (no[mid] < val)
      s = mid + 1;
  }
  return false;
}
bool f2(vector<int> no, int val) {
  for (int i = 0; i < no.size(); i++) {
    if (no[i] == val) return true;
  }
  return false;
}
int main() {
  int n, m;
  cin >> n >> m;
  srand(time(0));
  vector<int> no(m * 2);
  for (int i = 0; i < m * 2; i++) cin >> no[i];
  if (m * 2 == n)
    cout << 0;
  else {
    int val = rand() % (n - 1 + 1) + 1;
    vector<int> cpy(no.begin(), no.end());
    sort(cpy.begin(), cpy.end());
    while (found(cpy, val)) {
      val = rand() % (n - 1 + 1) + 1;
    }
    cout << n - 1 << endl;
    for (int i = 1; i <= n; i++) {
      if (i != val) {
        cout << val << " " << i << endl;
      }
    }
  }
  return 0;
}
