#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 1;
int n, m, x, y;
bool vis[maxn];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    vis[x] = true;
    vis[y] = true;
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      x = i;
      break;
    }
  }
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++)
    if (i != x) cout << x << " " << i << endl;
}
