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 x, y, n, q1, q2, q3, q4, m = 0, px = INT_MAX, py = INT_MAX;
  cin >> n >> x >> y;
  int t0 = 0, t1 = 0, t2 = 0, t3 = 0;
  vector<int> q(4, 0);
  vector<int> sx(4, INT_MAX);
  vector<int> sy(4, INT_MAX);
  vector<int> tex(4, INT_MAX);
  vector<int> tey(4, INT_MAX);
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (a - x > 0 && b - y > 0) {
      q[0]++;
      sx[0] = min(sx[0], abs(a - x));
      sy[0] = min(sy[0], abs(b - y));
    } else if (a - x < 0 && b - y > 0) {
      q[1]++;
      sx[1] = min(sx[1], abs(a - x));
      sy[1] = min(sy[1], abs(b - y));
    } else if (a - x > 0 && b - y < 0) {
      q[3]++;
      sx[3] = min(sx[3], abs(a - x));
      sy[3] = min(sy[3], abs(b - y));
    } else if (a - x < 0 && b - y < 0) {
      sx[2] = min(sx[2], abs(a - x));
      sy[2] = min(sy[2], abs(b - y));
      q[2]++;
    } else if (b - y == 0 && a - x > 0) {
      tex[0] = min(tex[0], abs(a - x));
      tey[0] = 0;
      t0++;
    } else if (a - x == 0 && b - y > 0) {
      tey[1] = min(tey[1], abs(b - y));
      tex[1] = 0;
      t1++;
    } else if (b - y == 0 && a - x < 0) {
      t2++;
      tex[2] = min(tex[2], abs(a - x));
      tey[2] = 0;
    } else {
      t3++;
      tey[3] = min(tey[3], abs(b - y));
      tex[3] = 0;
    }
  }
  m = max(m, q[1] + q[2] + t2);
  m = max(m, q[1] + q[0] + t1);
  m = max(m, q[2] + q[3] + t3);
  m = max(m, q[3] + q[0] + t0);
  if (m == q[1] + q[0] + t1) {
    px = x;
    py = y + min(min(sy[1], sy[0]), tey[1]);
  } else if (m == q[1] + q[2] + t2) {
    py = y;
    px = x - min(min(sx[1], sx[2]), tex[2]);
  } else if (m == q[2] + q[3] + t3) {
    px = x;
    py = y - min(min(sy[2], sy[3]), tey[3]);
  } else {
    py = y;
    px = x + min(min(sx[0], sx[3]), tex[0]);
  }
  cout << m << endl;
  cout << px << " " << py << endl;
}
