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;
void solve() {
  int n, sx, sy;
  scanf("%d %d %d", &n, &sx, &sy);
  vector<long long> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d %I64d", &x[i], &y[i]);
  }
  long long ans = -1, ax = -1, ay = -1;
  for (int dx = -1; dx <= 1; ++dx) {
    for (int dy = -1; dy <= 1; ++dy) {
      if (dx == 0 && dy == 0) continue;
      long long px = sx + dx, py = sy + dy;
      if (px < 0 || py < 0) continue;
      long long nans = 0;
      for (int i = 0; i < n; ++i) {
        long long nwl = std::abs(sx - px) + std::abs(sy - py) +
                        std::abs(x[i] - px) + std::abs(y[i] - py);
        if (nwl == std::abs(x[i] - sx) + std::abs(y[i] - sy)) {
          ++nans;
        }
      }
      if (nans > ans) {
        ax = px, ay = py;
        ans = nans;
      }
    }
  }
  printf("%I64d\n%I64d %I64d", ans, ax, ay);
}
int main() {
  int q = 1;
  while (q--) solve();
  return 0;
}
