#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int v[1001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  int c = 0;
  while (m--) {
    int x, y;
    cin >> x >> y;
    v[x] = 1;
    v[y] = 1;
  }
  for (long long i = 1; i < n + 1; i++)
    if (v[i] == 0) {
      c = i;
      break;
    }
  cout << n - 1 << endl;
  for (long long i = 1; i < n + 1; i++)
    if (c != i) cout << c << " " << i << endl;
  return 0;
}
