#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > xg, xl, yl, yg;
bool cmpy(pair<int, int> x, pair<int, int> y) { return x.second < y.second; }
bool cmpx(pair<int, int> x, pair<int, int> y) { return x.first < y.first; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, sx, sy, x, y;
  cin >> n >> sx >> sy;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (y < sy) yl.push_back({x, y});
    if (y > sy) yg.push_back({x, y});
    if (x > sx) xg.push_back({x, y});
    if (x < sx) xl.push_back({x, y});
  }
  sort(yl.begin(), yl.end(), cmpy);
  sort(yg.begin(), yg.end(), cmpy);
  reverse(yl.begin(), yl.end());
  sort(xl.begin(), xl.end(), cmpx);
  sort(xg.begin(), xg.end(), cmpx);
  reverse(xl.begin(), xl.end());
  pair<int, int> ans_p;
  int ans = 0;
  if (yl.size() > yg.size()) {
    ans = yl.size();
    ans_p = {sx, yl[0].second};
    if (xg.size() > xl.size()) {
      if (xg.size() > ans) {
        ans = xg.size();
        ans_p = {xg[0].first, sy};
      }
    } else {
      if (xl.size() > ans) {
        ans = xl.size();
        ans_p = {xl[0].first, sy};
      }
    }
  } else {
    if (yg.size()) ans = yg.size(), ans_p = {sx, yg[0].second};
    if (xg.size() > xl.size()) {
      if (xg.size() > ans) {
        ans = xg.size();
        ans_p = {xg[0].first, sy};
      }
    } else {
      if (xl.size() > ans) {
        ans = xl.size();
        ans_p = {xl[0].first, sy};
      }
    }
  }
  cout << ans << endl;
  cout << ans_p.first << " " << ans_p.second;
  return 0;
}
