1 1000000000 7
1000000000 9
 3 2 2
2 4
2 1
3 6
 2 1000000000 100000
1000000000 1000000
1000000000 10000
 1 100 100
50 70
 1 100 100
101 100

1
1000000000 8 2
2 3 1
1000000000 100001 1
99 100 1
101 100
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, sx, sy, ans;
  cin >> n >> sx >> sy;
  vector<int> x(n), y(n), before_sx, after_sx, before_sy, after_sy, sz;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (sx == x[i]) {
      (y[i] > sy) ? after_sy.push_back(y[i]) : before_sy.push_back(y[i]);
    } else {
      (x[i] > sx) ? after_sx.push_back(x[i]) : before_sx.push_back(x[i]);
    }
  }
  sort(after_sx.begin(), after_sx.end());
  sort(before_sx.begin(), before_sx.end());
  sort(after_sy.begin(), after_sy.end());
  sort(before_sy.begin(), before_sy.end());
  sz.push_back(after_sx.size());
  sz.push_back(before_sx.size());
  sz.push_back(after_sy.size());
  sz.push_back(before_sy.size());
  sort(sz.begin(), sz.end());
  cout << sz[3] << "\n";
  if (sz[3] == after_sx.size()) {
    cout << after_sx[0] << " " << sy;
    return 0;
  } else if (sz[3] == before_sx.size()) {
    cout << before_sx[0] << " " << sy;
    return 0;
  } else if (sz[3] == after_sy.size()) {
    cout << sx << " " << after_sy[0];
    return 0;
  } else {
    cout << sx << " " << before_sy[0];
    return 0;
  }
}
