#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, i, j, arr[1005] = {0};
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a >> b;
    arr[a] = 1;
    arr[b] = 1;
  }
  for (i = 1; i <= n; i++) {
    if (arr[i] == 0) break;
  }
  cout << n - 1 << endl;
  for (j = 1; j <= n; j++) {
    if (i != j) {
      cout << i << ' ' << j << endl;
    }
  }
  return 0;
}
