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 n, s1, s2, a, b, q1 = 0, q2 = 0, q3 = 0, q4 = 0, x, y, arr[9],
                             q5 = 0, q6 = 0, q7 = 0, q8 = 0;
  cin >> n >> s1 >> s2;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    x = a - s1;
    y = b - s2;
    if (y > 0 && x > 0) {
      q1++;
    }
    if (y > 0 && x < 0) {
      q2++;
    }
    if (y < 0 && x < 0) {
      q3++;
    }
    if (y < 0 && x > 0) {
      q4++;
    }
    if (y == 0 && x > 0) q5++;
    if (y > 0 && x == 0) q6++;
    if (y == 0 && x < 0) q7++;
    if (y < 0 && x == 0) q8++;
  }
  arr[0] = q1 + q5;
  arr[1] = q1 + q6;
  arr[2] = q2 + q6;
  arr[3] = q2 + q7;
  arr[4] = q3 + q7;
  arr[5] = q3 + q8;
  arr[6] = q4 + q8;
  arr[7] = q4 + q5;
  long long max = 0, index = 0;
  for (int i = 0; i < 8; i++) {
    if (arr[i] > max) {
      max = arr[i];
      index = i;
    }
  }
  if (index == 0) cout << arr[0] << "\n" << s1 + 1 << " " << s2;
  if (index == 1) cout << arr[1] << "\n" << s1 << " " << s2 + 1;
  if (index == 2) cout << arr[2] << "\n" << s1 << " " << s2 + 1;
  if (index == 3) cout << arr[3] << "\n" << s1 - 1 << " " << s2;
  if (index == 4) cout << arr[4] << "\n" << s1 - 1 << " " << s2;
  if (index == 5) cout << arr[5] << "\n" << s1 << " " << s2 - 1;
  if (index == 6) cout << arr[6] << "\n" << s1 + 1 << " " << s2 - 1;
  if (index == 7) cout << arr[7] << "\n" << s1 + 1 << " " << s2;
}
