#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return x == 0 ? y : gcd(y % x, x); }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
int fx[] = {1, -1, 0, 0};
int fy[] = {0, 0, 1, -1};
int kx[] = {-2, -2, +2, +2, +1, -1, +1, -1};
int ky[] = {+1, -1, +1, -1, -2, -2, +2, +2};
int dx[] = {+0, +0, -1, +1, +1, +1, -1, -1};
int dy[] = {+1, -1, +0, +0, -1, +1, +1, -1};
int X[] = {+1, +1, -1, -1};
int Y[] = {+1, -1, +1, -1};
int cnt = 0;
int dis[20];
bool vis[10001];
vector<int> adj[1000011];
int main() {
  int a, b, c, root = 1, n, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  map<pair<int, int>, int> mp;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    vis[a] = true;
    vis[b] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      root = i;
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (root == i) continue;
    v.push_back(make_pair(root, i));
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first << " " << v[i].second << endl;
  }
  return 0;
}
