#include <bits/stdc++.h>
using namespace std;
void debug_out() { cout << '[' << '\n'; }
template <typename T, typename... R>
void debug_out(const T &ff, const R &...rr) {
  cout << ff << ", ";
  debug_out(rr...);
}
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int mpow(int base, int exp);
template <class T>
T npow(T base, T exp);
const int mod = 1e9 + 7;
const int N = 3e5, M = N;
void Solve_main() {
  int x, y, p, q;
  int n, m, k;
  int i, j;
  cin >> n >> m;
  vector<bool> v(n + 1, true);
  for (i = (0); i < (m); ++i) {
    cin >> x >> y;
    v[x] = false;
    v[y] = false;
  }
  for (i = (1); i < (n + 1); ++i) {
    if (v[i]) {
      k = i;
      break;
    }
  }
  cout << n - 1 << '\n';
  for (i = (1); i < (n + 1); ++i) {
    if (i == k) {
      continue;
    }
    cout << k << " " << i << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int tc = 1;
  while (tc--) {
    Solve_main();
  }
  return 0;
}
int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % mod;
    base = ((long long)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
template <class T>
T npow(T base, T exp) {
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base);
    base = (base * base);
    exp >>= 1;
  }
  return result;
}
