#include <bits/stdc++.h>
using namespace std;
bool graph[1005];
int x, y;
int main() {
  int n, m, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    graph[x] = true;
    graph[y] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (graph[i] == false) {
      v = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) {
    if (v != i) {
      cout << v << " " << i << endl;
    }
  }
}
