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() {
  int n;
  cin >> n;
  int sx, sy;
  cin >> sx >> sy;
  int x[n], y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  int a = 0, b = 0, c = 0, d = 0;
  int u = 0, ni = 0, r = 0, l = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] < sx and y[i] > sy and x[i] >= 0 and x[i] <= 1000000000 and
        y[i] >= 0 and y[i] <= 1000000000)
      a++;
    else if (x[i] < sx and y[i] < sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      d++;
    else if (x[i] > sx and y[i] > sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      b++;
    else if (x[i] > sx and y[i] < sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      c++;
    else if (x[i] == sx and y[i] > sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      u++;
    else if (x[i] == sx and y[i] < sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      ni++;
    else if (x[i] < sx and y[i] == sy and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      l++;
    else if (y[i] == sy and x[i] > sx and x[i] >= 0 and x[i] <= 1000000000 and
             y[i] >= 0 and y[i] <= 1000000000)
      r++;
  }
  cout << a << " " << b << " " << c << " " << d << endl;
  cout << u << " " << r << " " << ni << " " << l << endl;
  int maxi = 0;
  maxi = max(maxi, a + l + d);
  maxi = max(maxi, a + u + b);
  maxi = max(maxi, b + r + c);
  maxi = max(maxi, c + ni + d);
  cout << maxi << endl;
  if ((a + b + u == maxi)) {
    cout << maxi << endl;
    cout << sx - 1 << " " << sy << endl;
  } else if (b + r + c == maxi) {
    cout << maxi << endl;
    cout << sx << " " << sy + 1 << endl;
  } else if (c + ni + d == maxi) {
    cout << maxi << endl;
    cout << sx + 1 << " " << sy << endl;
  } else if (d + l + a == maxi) {
    cout << maxi << endl;
    cout << sx << " " << sy - 1 << endl;
  }
  return 0;
}
