#include <bits/stdc++.h>
using namespace std;
template <class T>
string toStr(const T &x) {
  stringstream s;
  s << x;
  return s.str();
}
template <class T>
int toInt(const T &x) {
  stringstream s;
  s << x;
  int r;
  s >> r;
  return r;
}
int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> paila(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    paila[x] = paila[y] = true;
  }
  cout << n - 1 << endl;
  for (int i = 1; i < n + 1; i++) {
    if (!paila[i]) {
      for (int x = 1; x < n + 1; x++) {
        if (i != x) cout << i << " " << x << endl;
      }
      return 0;
    }
  }
  return 0;
}
