#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  int n, m, x, y;
  cin >> n >> m;
  set<int> se;
  for (int i = 0; i < m; i++) cin >> x >> y, se.insert(x), se.insert(y);
  cout << n - 1 << endl;
  int flag = 0, root;
  for (int i = 1; i <= n; i++) {
    for (auto x : se) {
      if (i == x) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      root = i;
      break;
    }
    flag = 0;
  }
  for (int i = 1; i <= n; i++)
    if (i != root) cout << root << " " << i << endl;
}
