#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const long double eps = 1e-07;
int n, m;
int a[2000];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    ++a[x];
    ++a[y];
  }
  for (int i = 0; i < n; ++i)
    if (a[i + 1] == 0) {
      printf("%d\n", n - 1);
      for (int j = 1; j <= n; ++j) {
        if (j != (i + 1)) printf("%d %d\n", i + 1, j);
      }
      return 0;
    }
  return 0;
}
