#include <bits/stdc++.h>
using namespace std;
void rotate(vector<long long int> arr, long long int n) {
  long long int x = arr[n - 1], i;
  for (i = n - 1; i > 0; i--) {
    arr[i] = arr[i - 1];
  }
  arr[0] = x;
}
void solve() {
  long long int n;
  cin >> n;
  long long int a[1003] = {0};
  long long int m;
  cin >> m;
  for (long long int i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    a[u] = 1;
    a[v] = 1;
  }
  long long int con = 0;
  for (long long int i = 1; i < n + 1; i++) {
    if (a[i] == 0) {
      con = i;
      break;
    }
  }
  cout << (n - 1) << endl;
  for (long long int i = 1; i < n + 1; i++) {
    if (i == con) {
      continue;
    } else {
      cout << i << " " << con << " ";
    }
    cout << endl;
  }
  cout << endl;
}
int main() {
  long long int t = 1;
  while (t-- > 0) {
    solve();
  }
}
