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() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, sx, sy, gxgy = 0, lxly = 0, lxgy = 0, gxly = 0, x1 = 0, y1 = 0,
                       x2 = 0, y2 = 0;
  cin >> n >> sx >> sy;
  vector<pair<long long, long long> > v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    if (v[i].first < sx && v[i].second < sy)
      lxly++;
    else if (v[i].first > sx && v[i].second > sy)
      gxgy++;
    if (v[i].second < sy && v[i].first > sx)
      gxly++;
    else if (v[i].second > sy && v[i].first < sx)
      lxgy++;
    else if (v[i].first == sx) {
      if (v[i].second > sy) {
        y1++;
      } else {
        y2++;
      }
    } else if (v[i].second == sy) {
      if (v[i].first > sx) {
        x1++;
      } else {
        x2++;
      }
    }
  }
  cout << gxgy << ' ' << gxly << ' ' << lxly << ' ' << lxgy << ' ' << x1 << ' '
       << x2 << ' ' << y1 << ' ' << y2 << endl;
  long long ans = max(max(gxgy + gxly + x1, lxgy + gxgy + y1),
                      max(lxgy + lxly + x2, gxly + lxly + y2));
  cout << ans << endl;
  if (ans == gxgy + gxly + x1) {
    cout << sx + 1 << ' ' << sy;
  } else if (ans == lxgy + gxgy + y1) {
    cout << sx << ' ' << sy + 1;
  } else if (ans == lxgy + lxly) {
    cout << sx - 1 << ' ' << sy;
  } else
    cout << sx << ' ' << sy - 1;
  return 0;
}
