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;
const long long MOD = 1e9 + 7;
const long long N = 1e5 + 7;
void solve() {
  long long n, sx, sy, x, y;
  cin >> n >> sx >> sy;
  long long c[5], lines[5];
  c[0] = c[1] = c[2] = c[3] = c[4] = 0;
  lines[0] = lines[1] = lines[2] = lines[3] = lines[4] = 0;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y;
    if (x == sx) {
      if (y > sy) {
        lines[1]++;
      } else {
        lines[3]++;
      }
    }
    if (y == sy) {
      if (x > sx) {
        lines[4]++;
      } else {
        lines[2]++;
      }
    }
    if (x > sx && y > sy) c[1]++;
    if (x > sx && y < sy) c[4]++;
    if (x < sx && y > sy) c[2]++;
    if (x < sx && y < sy) c[3]++;
  }
  long long res = LLONG_MIN;
  pair<long long, long long> coor = {-1, -1};
  if (c[1] + c[2] + lines[1] > res) {
    res = c[1] + c[2] + lines[1];
    coor = {sx, sy + 1};
  }
  if (c[2] + c[3] + lines[2] > res) {
    res = c[2] + c[3] + lines[2];
    coor = {sx - 1, sy};
  }
  if (c[3] + c[4] + lines[3] > res) {
    res = c[3] + c[4] + lines[3];
    coor = {sx, sy - 1};
  }
  if (c[1] + c[4] + lines[4] > res) {
    res = c[1] + c[4] + lines[4];
    coor = {sx + 1, sy};
  }
  cout << res << endl;
  cout << coor.first << " " << coor.second << endl;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
