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;
int main() {
  long long int n, sx, sy, x, y;
  cin >> n >> sx >> sy;
  vector<pair<long long int, long long int> > vp;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    vp.push_back(make_pair(x, y));
  }
  long long int r1 = 0, r2 = 0, r3 = 0, r4 = 0;
  for (int i = 0; i < n; i++) {
    if (vp[i].first < sx && vp[i].second < sy) r1++;
    if (vp[i].first < sx && vp[i].second > sy) r2++;
    if (vp[i].first > sx && vp[i].second < sy) r3++;
    if (vp[i].first > sx && vp[i].second > sy) r4++;
  }
  long long int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
  for (int i = 0; i < n; i++) {
    if (vp[i].first < sx && vp[i].second == sy) x1++;
    if (vp[i].first > sx && vp[i].second == sy) x2++;
    if (vp[i].second < sy && vp[i].first == sx) y1++;
    if (vp[i].second > sy && vp[i].first == sx) y2++;
  }
  if (r1 + r2 + x1 >= max(max(r2 + r4 + y2, r3 + r4 + x2), r3 + r1 + y1)) {
    cout << r1 + r2 + x1 << endl;
    cout << sx - 1 << " " << sy << endl;
  } else if (r4 + r2 + y2 >=
             max(max(r2 + r1 + x1, r3 + r4 + x2), r3 + r1 + y1)) {
    cout << r4 + r2 + y2 << endl;
    cout << sx << " " << sy + 1 << endl;
  } else if (r3 + r4 + x2 >=
             max(max(r2 + r4 + y2, r1 + r2 + x1), r3 + r1 + y1)) {
    cout << r3 + r4 + x2 << endl;
    cout << sx + 1 << " " << sy << endl;
  } else if (r1 + r3 + y1 >=
             max(max(r2 + r1 + x1, r2 + r4 + y2), r3 + r4 + x2)) {
    cout << r1 + r3 + y1 << endl;
    cout << sx << " " << sy - 1 << endl;
  }
}
