#include <bits/stdc++.h>
using namespace std;
unsigned long long int a1[40], sum[40];
void solve() {
  long long int a, b, c, d, i, j, k, l;
  cin >> a >> b;
  bool visited[a + 1];
  memset(visited, false, sizeof(visited));
  for (i = 0; i < b; i++) {
    cin >> c >> d;
    visited[c] = true;
    visited[d] = true;
  }
  for (i = 1; i <= a; i++)
    if (visited[i] == false) {
      cout << a - 1 << endl;
      for (j = 1; j <= a; j++) {
        if (j != i) {
          cout << i << " " << j << endl;
        }
      }
      break;
    }
}
int main() {
  solve();
  unsigned long long int ans;
}
