#include <bits/stdc++.h>
using namespace std;
bool isprime(int64_t n) {
  for (int64_t i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int64_t factorial(int64_t n) {
  return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
int64_t gcd(int64_t a, int64_t b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int64_t lcm(int64_t a, int64_t b) { return (a / gcd(a, b) * b); }
int64_t max(int64_t a, int64_t b) {
  int64_t sol = a > b ? a : b;
  return sol;
}
int64_t min(int64_t a, int64_t b) {
  int64_t sol = a < b ? a : b;
  return sol;
}
int64_t power(int64_t x, int64_t y) {
  int64_t ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans *= x;
    }
    y >>= 1LL;
    x *= x;
  }
  return ans;
}
int64_t mod = 1000000007;
vector<int64_t> g[1001];
inline int64_t solve() {
  int64_t n, k, u, v;
  cin >> n >> k;
  cout << n - 1 << "\n";
  for (int64_t i = 0; i <= k - 1; ++i) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int64_t i = 1; i <= n; ++i) {
    if (g[i].size() == 0) {
      for (int64_t j = 1; j <= n; ++j) {
        if (i != j) {
          cout << i << " " << j << "\n";
        }
      }
      break;
    }
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
