#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long a[N];
void solve() {
  long long n, t;
  cin >> n >> t;
  set<long long> s;
  for (int i = 1; i <= n; i++) s.insert(i);
  while (t--) {
    long long a, b;
    cin >> a >> b;
    s.erase(a);
    s.erase(b);
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i != *s.begin()) cout << i << " " << *s.begin() << endl;
  }
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) solve();
  return 0;
}
