#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, ele, ele1;
  cin >> n >> m;
  map<int, bool> a;
  for (i = 0; i < m; i++) {
    cin >> ele >> ele1;
    a[ele] = a[ele1] = true;
  }
  for (i = 1; i <= n; i++)
    if (!a[i]) break;
  cout << n - 1 << endl;
  for (j = 1; j <= n; j++) {
    if (j == i) continue;
    cout << i << " " << j << endl;
  }
}
