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, x, y, a[2], b[6] = {0, 0, 0, 0, 0, 0}, c[7] = {0, 0, 0, 0, 0, 0, 0},
                     max1, max2, z, k1, k2, r;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    cin >> a[1] >> a[2];
    if (a[1] > x) {
      if (a[2] > y) {
        b[1]++;
        b[5]++;
      }
      if (a[2] < y) {
        b[0]++;
        b[4]++;
      }
    }
    if (a[1] < x) {
      if (a[2] > y) b[2]++;
      if (a[2] < y) b[3]++;
    }
    if (a[1] == x) {
      if (a[2] > y) {
        c[2]++;
        c[6]++;
      } else {
        c[0]++;
        c[4]++;
      }
    }
    if (a[2] == y) {
      if (a[1] > x) {
        c[1]++;
        c[5]++;
      } else
        c[3]++;
    }
  }
  max1 = b[1];
  for (int i = 1; i < 5; i++) {
    if (max1 < b[i]) {
      max1 = b[i];
      k1 = i;
    }
  }
  max2 = c[1];
  for (int i = 1; i < 5; i++) {
    if (max2 < c[i]) {
      max2 = c[i];
      k2 = i;
    }
  }
  if (k2 != 0)
    max2 = c[k2] + b[k2] + b[k2 - 1];
  else if (k2 == 0)
    max2 = c[k2] + b[k2] + b[3];
  if ((b[k1 - 1]) >= (b[k1 + 1])) {
    if (b[k1 - 1] == 0) {
      if (c[k1] >= c[k1 + 1]) {
        r = k1;
        z = max1 + c[k1];
      } else {
        r = k1 + 1;
        z = max1 + c[k1 + 1];
      }
    } else {
      z = max1 + b[k1 - 1] + c[k1];
      r = k1;
    }
  } else {
    if (b[k1 + 1] == 0) {
      if (c[k1] >= c[k1 + 1]) {
        r = k1;
        z = max1 + c[k1];
      } else {
        r = k1 + 1;
        z = max1 + c[k1 + 1];
      }
    } else {
      z = max1 + b[k1 + 1] + c[k1 + 1];
      r = k1 + 1;
    }
  }
  if ((max2 <= z) || (max2 > n))
    cout << z << endl;
  else
    cout << max2 << endl;
  if ((r == 0) || (r == 4)) cout << x << " " << y - 1;
  if ((r == 1) || (r == 5)) cout << x + 1 << " " << y;
  if (r == 2) cout << x << " " << y + 1;
  if (r == 3) cout << x - 1 << " " << y;
}
