#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> is(n + 1, 1);
  is[0] = 0;
  vector<pair<int, int> > arr;
  for (int u = 0; u < m; u++) {
    int x, y;
    cin >> x >> y;
    is[x] = 0;
    is[y] = 0;
  }
  vector<int>::iterator it;
  it = std::find(is.begin(), is.end(), 1);
  int g = it - is.begin();
  cout << n - 1 << endl;
  for (int h = 1; h < n + 1; h++) {
    if (h == g) {
      continue;
    } else {
      cout << h << " " << g << endl;
    }
  }
  return 0;
}
