#include <bits/stdc++.h>
using namespace std;
bool fail[1024];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    fail[a] = fail[b] = 1;
  }
  int x = 1;
  while (fail[x]) ++x;
  cout << n - 1 << '\n';
  for (int i = 1; i < n; ++i) cout << i + (i >= x) << ' ' << x << '\n';
}
