#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n, m;
  cin >> n >> m;
  vector<bool> check(n + 1);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    check[u] = 1;
    check[v] = 1;
  }
  int i = 0;
  for (i = 1; i <= n; i++) {
    if (!check[i]) {
      break;
    }
  }
  cout << n - 1 << endl;
  for (int j = 1; j <= n; j++) {
    if (i == j) continue;
    cout << i << ' ' << j << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) Solve();
}
