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 i, j, n, x, y, a, b;
  int arr[2][2], brr[2][2], crr[2][2];
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) arr[i][j] = brr[i][j] = crr[i][j] = 0;
  }
  cin >> n >> x >> y;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    if (a > x && b > y)
      arr[0][1]++;
    else if (a > x && b < y)
      arr[1][1]++;
    else if (a < x && b > y)
      arr[0][0]++;
    else if (a < x && b < y)
      arr[1][0]++;
    else if (a == x) {
      if (b > y) {
        brr[0][0]++;
        brr[0][1]++;
      } else {
        brr[1][0]++;
        brr[1][1]++;
      }
    } else if (b == y) {
      if (a > x) {
        crr[1][1]++;
        crr[0][1]++;
      } else {
        crr[0][0]++;
        crr[1][0]++;
      }
    }
  }
  if (arr[0][0] > arr[0][1] && arr[0][0] > arr[1][0] && arr[0][0] > arr[1][1]) {
    if (brr[0][0] == crr[0][0]) {
      if (arr[0][1] > arr[1][0]) {
        cout << arr[0][0] + brr[0][0] + arr[0][1] << "\n";
        cout << x << " " << (y + 1) << "\n";
      } else {
        cout << arr[0][0] + brr[0][0] + arr[1][0] << "\n";
        cout << x - 1 << " " << y << "\n";
      }
    } else if (brr[0][0] > crr[0][0]) {
      cout << arr[0][0] + brr[0][0] << "\n";
      cout << x << " " << (y + 1) << "\n";
    } else {
      cout << arr[0][0] + crr[0][0] << "\n";
      cout << x - 1 << " " << y << "\n";
    }
  } else if (arr[0][1] > arr[1][0] && arr[0][1] > arr[1][1]) {
    if (brr[0][1] == crr[0][1]) {
      if (arr[0][0] > arr[1][1]) {
        cout << arr[0][1] + brr[0][1] + arr[0][0] << "\n";
        cout << x << " " << (y + 1) << "\n";
      } else {
        cout << arr[0][1] + brr[0][0] + arr[1][1] << "\n";
        cout << x + 1 << " " << y << "\n";
      }
    } else if (brr[0][1] > crr[0][1]) {
      cout << arr[0][1] + brr[0][1] << "\n";
      cout << x << " " << (y + 1) << "\n";
    } else {
      cout << arr[0][1] + crr[0][1] << "\n";
      cout << x + 1 << " " << y << "\n";
    }
  } else if (arr[1][0] > arr[1][1]) {
    if (brr[1][0] == crr[1][0]) {
      if (arr[0][0] > arr[1][1]) {
        cout << arr[1][0] + brr[1][0] + arr[0][0] << "\n";
        cout << x - 1 << " " << y << "\n";
      } else {
        cout << arr[1][0] + brr[1][0] + arr[1][1] << "\n";
        cout << x << " " << y - 1 << "\n";
      }
    } else if (brr[1][0] > crr[1][0]) {
      cout << arr[1][0] + brr[1][0] << "\n";
      cout << x << " " << (y - 1) << "\n";
    } else {
      cout << arr[1][0] + crr[1][0] << "\n";
      cout << x - 1 << " " << y << "\n";
    }
  } else {
    if (brr[1][1] == crr[1][1]) {
      if (arr[0][1] > arr[1][0]) {
        cout << arr[1][1] + brr[1][1] + arr[0][1] << "\n";
        cout << x + 1 << " " << y << "\n";
      } else {
        cout << arr[1][0] + brr[1][1] + arr[1][1] << "\n";
        cout << x << " " << y - 1 << "\n";
      }
    } else if (brr[1][1] > crr[1][1]) {
      cout << arr[1][1] + brr[1][1] << "\n";
      cout << x << " " << (y - 1) << "\n";
    } else {
      cout << arr[1][1] + crr[1][1] << "\n";
      cout << x + 1 << " " << y << "\n";
    }
  }
  return 0;
}
