#include <bits/stdc++.h>
using namespace std;
const int maxn = 1111111;
const double inf = 0.000001;
const int INF = 111111111;
const int mod = 1000000007;
int edge[1111][1111], n, m, vis[1111], flag;
int main() {
  scanf("%d", &n), scanf("%d", &m);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      if (i == j)
        edge[i][j] = 0;
      else
        edge[i][j] = 1;
  int u, v;
  while (m--) {
    scanf("%d", &u), scanf("%d", &v);
    edge[u][v] = edge[v][u] = INF;
  }
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++) {
    int t = 0;
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        if (edge[i][j] == 1) t++;
      }
    }
    if (t == n - 1) {
      for (int j = 1; j <= n; j++)
        if (i != j) printf("%d %d\n", i, j);
      break;
    }
  }
  return 0;
}
