#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> check(n + 1, 0);
  for (long long i = 0; i < (m); ++i) {
    int a, b;
    cin >> a >> b;
    check[a] = 1;
    check[b] = 1;
  }
  int mid;
  for (long long i = (1); i < (n + 1); ++i) {
    if (!check[i]) mid = i;
  }
  cout << n - 1 << endl;
  for (long long i = (1); i < (n + 1); ++i) {
    if (i != mid) cout << mid << " " << i << endl;
  }
}
