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;
int32_t main() {
  ios::sync_with_stdio(false);
  int d[8][2] = {{1, 0},  {1, 1},   {1, -1}, {0, 1},
                 {0, -1}, {-1, -1}, {-1, 1}, {-1, 0}};
  int answ = 0, n, sx, sy, p = 0;
  cin >> n >> sx >> sy;
  int a[n][2];
  for (int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1];
  for (int i = 0; i < 8; i++) {
    int x = sx + d[i][0], y = sy + d[i][1];
    if (x >= 0 && y >= 0 && x <= 1000000000 && y <= 1000000000) {
      int cur = 0;
      for (int j = 0; j < n; j++) {
        int left = min(sx, a[j][0]), right = max(sx, a[j][0]),
            top = max(sy, a[j][1]), bottom = min(sy, a[j][1]);
        if (x >= left && x <= right && y >= bottom && y <= top) cur++;
      }
      if (cur > answ) answ = cur, p = i;
    }
  }
  cout << answ << '\n';
  cout << sx + d[p][0] << ' ' << sy + d[p][1];
  return 0;
}
