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 n, sx, sy, p1, p2, p3, p4, cx, cy, ans, p11, p22, p33, p44;
int arr[200001][2];
int main() {
  cin >> n >> sx >> sy;
  p11 = 0;
  p22 = 0;
  p33 = 0;
  p44 = 0;
  p1 = 0;
  p2 = 0;
  p3 = 0;
  p4 = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1];
    arr[i][0] -= sx;
    arr[i][1] -= sy;
  }
  for (int i = 0; i < n; i++) {
    if (arr[i][0] > 0 && arr[i][1] > 0) {
      p1 += 1;
    }
    if (arr[i][0] > 0 && arr[i][1] < 0) {
      p4 += 1;
    }
    if (arr[i][0] < 0 && arr[i][1] > 0) {
      p2 += 1;
    }
    if (arr[i][0] < 0 && arr[i][1] < 0) {
      p3 += 1;
    }
    if (arr[i][0] == 0) {
      if (arr[i][1] > 0) {
        p11++;
      } else {
        p22++;
      }
    }
    if (arr[i][1] == 0) {
      if (arr[i][0] > 0) {
        p33++;
      } else {
        p44++;
      }
    }
  }
  if (p1 >= p2 && p1 >= p3 && p1 >= p4) {
    if (p11 >= p33) {
      ans = p1 + p11;
      cx = 0 + sx;
      cy = 1 + sy;
    } else {
      ans = p1 + p33;
      cx = 1 + sx;
      cy = 0 + sy;
    }
  } else if (p2 >= p1 && p2 >= p3 && p2 >= p4) {
    if (p11 >= p44) {
      ans = p2 + p11;
      cx = 0 + sx;
      cy = 1 + sy;
    } else {
      ans = p2 + p44;
      cx = -1 + sx;
      cy = 0 + sy;
    }
  } else if (p3 >= p2 && p3 >= p1 && p3 >= p4) {
    if (p22 >= p44) {
      ans = p3 + p22;
      cx = 0 + sx;
      cy = -1 + sy;
    } else {
      ans = p3 + p44;
      cx = -1 + sx;
      cy = 0 + sy;
    }
  } else {
    if (p22 >= p33) {
      ans = p4 + p22;
      cx = 0 + sx;
      cy = -1 + sy;
    } else {
      ans = p4 + p33;
      cx = 1 + sx;
      cy = 0 + sy;
    }
  }
  cout << ans << "\n" << cx << " " << cy;
}
