#include <bits/stdc++.h>
using namespace std;
long long POS(long long x) {
  if (x > 0)
    return x;
  else
    return 0;
}
struct ele {
  long double z, y, x;
  ele() {}
  ele(long double z, long double y, long double x) : z(z), y(y), x(x) {}
  ele operator+(const ele &p) const { return ele(z + p.z, y + p.y, x + p.x); }
  ele operator-(const ele &p) const { return ele(z - p.z, y - p.y, x - p.x); }
  ele operator*(long double con) const {
    return ele(z * con, y * con, x * con);
  }
  ele operator/(long double con) const {
    return ele(z / con, y / con, x / con);
  }
  bool operator<(const ele &rhs) const {
    return make_pair(z, make_pair(y, x)) <
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
  bool operator==(const ele &rhs) const {
    return make_pair(z, make_pair(y, x)) ==
           make_pair(rhs.z, make_pair(rhs.y, rhs.x));
  }
};
const bool testing = 0;
void program() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  cout << n - 1 << endl;
  vector<int> v(2 * m);
  for (int i = 0; i < 2 * m; i += 2) {
    cin >> v[i] >> v[i + 1];
  }
  sort(v.begin(), v.end());
  int ans = n;
  for (int i = (0); i < (2 * m); ++i) {
    if (v[i] != i + 1) {
      ans = i + 1;
      break;
    }
  }
  for (int i = (0); i < (n); ++i) {
    if (i + 1 == ans) continue;
    cout << ans << " " << i + 1 << endl;
  }
}
int main() {
  if (!testing) {
    program();
    return 0;
  }
  FILE *fin = NULL;
  fin = fopen("in.txt", "w+");
  fprintf(fin, "4 1\n1 3\n");
  fclose(fin);
  freopen("in.txt", "r", stdin);
  printf("test case(1) => expected : \n");
  printf("3\n1 2\n4 2\n2 3\n");
  printf("test case(1) => founded  : \n");
  program();
  return 0;
}
