#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, x, y, arr[1009] = {0};
  cin >> n >> m;
  while (m--) {
    cin >> x >> y;
    arr[x] = 1;
    arr[y] = 1;
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++)
    if (arr[i] == 0) {
      for (int q = 1; q <= n; q++)
        if (q != i) cout << i << " " << q << endl;
      break;
    }
}
