#include <bits/stdc++.h>
using namespace std;
const int V = 1000 + 5;
const int MaxN = 60 + 5;
int n, m;
bool visit[V];
int main() {
  int i, j;
  cin >> n >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    visit[a] = visit[b] = true;
  }
  for (i = 1; i <= n; ++i)
    if (!visit[i]) break;
  cout << n - 1 << endl;
  for (j = 1; j <= n; ++j)
    if (j != i) cout << i << " " << j << endl;
}
