#include <bits/stdc++.h>
using namespace std;
inline bool eql(double a, double b) { return fabs(a - b) < 1e-9; }
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  bool mark[1123];
  memset(mark, false, sizeof mark);
  int x, y;
  while (m--) cin >> x >> y, mark[x] = true, mark[y] = true;
  for (x = 1; x <= n; x++)
    if (!mark[x]) break;
  cout << n - 1 << "\n";
  for (int i = 1; i <= n; i++) {
    if (i != x) cout << x << ' ' << i << "\n";
  }
  return 0;
}
