#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> v;
  vector<int> v1;
  v1.push_back(0);
  for (int i = 0; i <= n; i++) {
    v.push_back(v1);
  }
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  int p;
  for (int i = 1; i < v.size(); i++) {
    if (v[i].size() == 1) {
      p = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (i != p) {
      cout << p << " " << i << endl;
    }
  }
  return 0;
}
