#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, m, n, a[11111], b[11111], c[11111], t, ll, s, d, e, f, g,
    pp, aa, bb, cc;
map<long long, long long> y, x;
vector<long long> p, q, r;
int main() {
  cin >> n;
  l = 1000000001;
  for (i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    p.push_back(a[i]);
    q.push_back(b[i]);
    y[a[i] * 2 * l + b[i]] = 1;
    c[i] = (a[i] + l) * 2 * l + b[i] + l;
  }
  sort(c, c + n);
  for (i = 0; i < n; i++) {
    a[i] = c[i] / (2 * l) - l;
    b[i] = c[i] % (2 * l) - l;
  }
  for (i = 0; i < n; i++) {
    t = 2 * l + 1;
    m = -2 * l - 1;
    for (j = i + 1; j < n; j++) {
      if (a[j] > a[i]) {
        if (b[j] >= b[i]) {
          if (b[j] - b[i] < t) {
            if (y[a[j] * 2 * l + b[i]] == 0) {
              p.push_back(a[j]);
              q.push_back(b[i]);
              y[a[j] * 2 * l + b[i]] = 1;
            }
            t = b[j] - b[i];
          }
        } else {
          if (b[j] - b[i] > m) {
            if (y[a[j] * 2 * l + b[i]] == 0) {
              p.push_back(a[j]);
              q.push_back(b[i]);
              y[a[j] * 2 * l + b[i]] = 1;
            }
            m = b[j] - b[i];
          }
        }
      }
    }
  }
  cout << p.size() << endl;
  for (i = 0; i < p.size(); i++) cout << p[i] << ' ' << q[i] << endl;
}
