#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main() {
  int n, m;
  int ans;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[x] = 1;
    a[y] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      ans = i;
      break;
    }
  }
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++) {
    if (i == ans) continue;
    printf("%d %d\n", ans, i);
  }
  return 0;
}
