#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n + 1][n + 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j)
        a[i][j] = 1;
      else
        a[i][j] = 0;
    }
  }
  while (m--) {
    int x, y;
    cin >> x >> y;
    a[x][y] = 0;
    a[y][x] = 0;
  }
  for (int i = 1; i <= n; i++) {
    int count = 0;
    for (int j = 1; j <= n; j++) {
      if (a[i][j] != 0) count++;
    }
    if (count == n - 1) {
      cout << n - 1 << endl;
      {
        for (int c = 1; c <= n; c++) {
          if (i != c) cout << i << " " << c << endl;
        }
      }
      break;
    }
  }
}
