#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<bool> visited(n, false);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    visited[x - 1] = true;
    visited[y - 1] = true;
  }
  int root = -1;
  for (int i = 0; i < n; i++) {
    if (!visited[i]) {
      root = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 0; i < n; i++) {
    if (i == root) continue;
    cout << i + 1 << " " << root + 1 << endl;
  }
  return 0;
}
