#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int mod = 1e9 + 7;
const int N = 1e3 + 10;
const int L = 10;
const double eps = 1e-9;
const int BIG = 1e6;
int f[N];
int main() {
  clock_t tm = clock();
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  int __t = 1;
  for (int _t = 1; _t <= __t; ++_t) {
    memset(f, 0, sizeof(f));
    int n, m;
    cin >> n >> m;
    for (int i = 0; i <= m - 1; ++i) {
      int u, v;
      cin >> u >> v;
      f[u]++;
      f[v]++;
    }
    int c = 0;
    for (int i = 1; i <= n; ++i) {
      if (!f[i]) {
        c = i;
        break;
      }
    }
    cout << n - 1 << "\n";
    for (int i = 1; i <= n; ++i) {
      if (i != c) cout << i << " " << c << "\n";
    }
  }
  tm = clock() - tm;
  cerr << (float)(tm) / CLOCKS_PER_SEC << "\n";
  return 0;
}
