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 N = 1234567;
const long long MOD = 998244353;
long long c1, c2, c3, c4, c5, c6, c7, c8;
void solve() {
  long long n, sx, sy;
  cin >> n >> sx >> sy;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    if (x == sx || y == sy) {
      if (y == sy && x < sx)
        c2++;
      else if (y == sy && x > sx)
        c6++;
      if (x == sx && y < sy)
        c8++;
      else if (x == sx && y > sy)
        c4++;
    } else {
      if (x <= sx) {
        if (y <= sy) {
          c1++;
        } else {
          c3++;
        }
      } else {
        if (y <= sy) {
          c7++;
        } else {
          c5++;
        }
      }
    }
  }
  long long k = max((c1 + c2 + c3),
                    max((c3 + c4 + c5), max((c5 + c6 + c7), (c7 + c8 + c1))));
  ;
  if (k == (c1 + c2 + c3)) {
    cout << k << endl;
    cout << (sx - 1) << " " << sy;
  } else if (k == (c5 + c4 + c3)) {
    cout << k << endl;
    cout << sx << " " << (sy + 1);
  } else if (k == (c5 + c6 + c7)) {
    cout << k << endl;
    cout << sx + 1 << " " << sy;
  } else if (k == (c1 + c7 + c8)) {
    cout << k << endl;
    cout << sx << " " << (sy - 1);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
