#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
template <typename X>
using arr = vector<X>;
template <typename X>
using matrix = arr<arr<X>>;
const ll INF = (ll)1e9 + 6ll;
const int fall = false - true;
const arr<int> DX = {+1, -1, 0, 0, +1, -1, -1, +1};
const arr<int> DY = {0, 0, +1, -1, +1, -1, +1, -1};
template <typename X>
bool soft(X& a, const X b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename X>
bool strong(X& a, const X b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void freeopen() {}
void timebreak() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
signed main() {
  freeopen();
  timebreak();
  int n, m;
  cin >> n >> m;
  arr<bool> was(n, false);
  while (m--) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    was[u] = was[v] = true;
  }
  cout << n - 1 << '\n';
  int v, pos = false;
  for (bool x : was) {
    if (!x) {
      v = pos;
      break;
    }
    pos++;
  }
  for (int i = 0; i < n; i++) {
    if (i == v) continue;
    cout << i + 1 << " " << v + 1 << "\n";
  }
  return false;
}
