#include <bits/stdc++.h>
using namespace std;
int inc[1003];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    inc[x]++;
    inc[y]++;
  }
  int sec = 0;
  for (int i = 1; i <= n; i++) {
    if (!inc[i]) {
      sec = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i != sec) cout << sec << " " << i << endl;
  }
  return 0;
}
