#include <bits/stdc++.h>
using namespace std;
int main() {
  bool A[1010];
  for (int i = 0; i < 1010; i++) A[i] = true;
  int a, b, x = 1, y;
  cin >> a >> b;
  for (int i = 0; i < b; i++) {
    cin >> x >> y;
    A[x] = false;
    A[y] = false;
  }
  for (int i = 1; i <= a; i++) {
    if (A[i]) {
      x = i;
      break;
    }
  }
  cout << a - 1 << endl;
  for (int i = 1; i <= a; i++) {
    if (i != x) cout << x << " " << i << endl;
  }
}
