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