#include <bits/stdc++.h>
using namespace std;
int const mod = 1000000007;
int v[1005];
int main() {
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a] = 1;
    v[b] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!v[i]) a = i;
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++)
    if (a != i) cout << a << " " << i << "\n";
  return 0;
}
