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 g(int a) {
  if (a < 0) a += 8;
  if (a > 7) a -= 8;
  return a;
}
int main() {
  long long n, sx, sy;
  cin >> n >> sx >> sy;
  vector<long long> cnt(8);
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    if (x == sx) {
      if (y > sy)
        cnt[0]++;
      else
        cnt[4]++;
    } else if (y == sy) {
      if (x > sx)
        cnt[2]++;
      else
        cnt[6]++;
    } else if (x > sx && y > sy)
      cnt[1]++;
    else if (x > sx && y < sy)
      cnt[3]++;
    else if (x < sx && y < sy)
      cnt[5]++;
    else if (x < sx && y > sy)
      cnt[7]++;
  }
  int res = 0, ans = 0;
  for (int i = 0; i < 8; i++) {
    if (cnt[g(i - 1)] + cnt[i] + cnt[g(i + 1)] > res)
      res = cnt[g(i - 1)] + cnt[i] + cnt[g(i + 1)], ans = i;
  }
  cout << res << endl;
  if (ans == 0) cout << sx << ' ' << sy + 1;
  if (ans == 1) cout << sx + 1 << ' ' << sy + 1;
  if (ans == 2) cout << sx + 1 << ' ' << sy;
  if (ans == 3) cout << sx + 1 << ' ' << sy - 1;
  if (ans == 4) cout << sx << ' ' << sy - 1;
  if (ans == 5) cout << sx - 1 << ' ' << sy - 1;
  if (ans == 6) cout << sx - 1 << ' ' << sy;
  if (ans == 7) cout << sx - 1 << ' ' << sy + 1;
  return 0;
}
