#include <bits/stdc++.h>
using namespace std;
const int imax = INT32_MAX;
const int imin = INT32_MIN;
const int mx = 1e9;
const long long int inf = 1e18;
template <class T>
void print(vector<T> vec) {
  for (T i : vec) cout << i << "\n";
  cout << "";
}
template <class T>
void alloc(vector<vector<T>*> vec, T n) {
  for (auto v : vec) v->resize(n + 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> nums(n + 1);
    for (int i = 0; i < m; ++i) {
      int l, r;
      cin >> l >> r;
      nums[l]++;
      nums[r]++;
    }
    int node = -1;
    for (int i = 1; i <= n; ++i) {
      if (nums[i] == 0) {
        node = i;
        break;
      }
    }
    cout << n - 1 << "\n";
    for (int i = 1; i <= n; ++i) {
      if (node == i) continue;
      cout << node << " " << i << "\n";
    }
  }
  return 0;
}
