#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  int a[m + 1], b[m + 1];
  int x = 0, count1 = 0, count2 = 0;
  if (n == 1) {
    cout << "0" << endl;
    return;
  }
  if (n == 2) {
    cout << "1" << endl;
    cout << "1"
         << " "
         << "2";
    return;
  }
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }
  sort(a, a + m);
  sort(b, b + m);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < m; j++)
      if (i != a[j]) {
        count1++;
      }
    for (int j = 0; j < m; j++)
      if (i != b[j]) {
        count2++;
      }
    if (count1 + count2 == 2 * m)
      x = i;
    else {
      count1 = 0, count2 = 0;
    }
  }
  if (x == 0) x = 1;
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i != x) cout << x << " " << i << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) solve();
  return 0;
}
