#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
bool vis[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    vis[a] = true;
    vis[b] = true;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      ans = i;
      break;
    }
  }
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++) {
    if (i == ans) continue;
    int tmp1, tmp2;
    tmp1 = i;
    tmp2 = ans;
    if (tmp1 > tmp2) swap(tmp1, tmp2);
    printf("%d %d\n", tmp1, tmp2);
  }
  return 0;
}
