#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, idx;
bool forbiden[3010][3010];
bool no[3010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    forbiden[x][y] = 1;
    forbiden[y][x] = 1;
    no[x] = 1;
    no[y] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (!no[i]) {
      idx = i;
      break;
    }
  cout << n - 1 << "\n";
  for (int i = 1; i <= n; i++) {
    if (i == idx) continue;
    cout << i << " " << idx << "\n";
  }
  return 0;
}
