#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool arr[n + 1];
  memset(arr, 1, sizeof(arr));
  int buff;
  for (int i = 0; i < m; i++) {
    cin >> buff;
    arr[buff] = 0;
    cin >> buff;
    arr[buff] = 0;
  }
  int ans;
  for (int i = 1; i < n + 1; i++) {
    if (arr[i] == 1) {
      ans = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i < n + 1; i++) {
    if (i != ans) cout << i << " " << ans << endl;
  }
  return 0;
}
