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>
#pragma GCC optimize("O3")
constexpr auto INF = 9223372036854775807;
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
inline long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int mod_power(long long int x, long long int y) {
  long long int res = 1;
  x = x % (long long int)2;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % (long long int)2;
    y = y >> 1;
    x = (x * x) % (long long int)2;
  }
  return res;
}
long long modInverse(long long n) { return mod_power(n, (long long int)2 - 2); }
long long nCrModPFermat(long long n, long long int r) {
  if (r == 0) return 1;
  vector<long long int> fac(n + 1, 0);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % (long long int)2;
  return (fac[n] * modInverse(fac[r]) % (long long int)2 *
          modInverse(fac[n - r]) % (long long int)2) %
         (long long int)2;
}
bool isprime(long long int n) {
  if (n == 2) return true;
  if (n % 2 == 0 || n == 1) {
    return false;
  }
  for (long long int j = 3; j <= sqrt(n); j += 2) {
    if (n % j == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long int n, x, y;
  cin >> n >> x >> y;
  long long int one = 0, two = 0, three = 0, four = 0;
  vector<pair<long long int, long long int>> arr(n, make_pair(0, 0));
  for (long long int i = 0; i < n; i += 1) {
    long long int a, b;
    cin >> a >> b;
    a -= x;
    b -= y;
    arr[i] = make_pair(a, b);
  }
  long long int cnt = 0;
  pair<long long int, long long int> ans = make_pair(0, 0);
  long long int temp = 0;
  for (auto i : arr) {
    if (i.second == 0 && i.first > 0)
      temp += 1;
    else if (i.first > 0 && i.second > 0)
      temp += 1;
    else if (i.first > 0 && i.second < 0)
      temp += 1;
  }
  if (temp > cnt) {
    cnt = temp;
    ans = make_pair(x + 1, y);
  }
  temp = 0;
  for (auto i : arr) {
    if (i.second == 0 && i.first < 0)
      temp += 1;
    else if (i.first < 0 && i.second > 0)
      temp += 1;
    else if (i.first < 0 && i.second < 0)
      temp += 1;
  }
  if (temp > cnt && x - 1 >= 0) {
    cnt = temp;
    ans = make_pair(x - 1, y);
  }
  temp = 0;
  for (auto i : arr) {
    if (i.second > 0 && i.first == 0)
      temp += 1;
    else if (i.first < 0 && i.second > 0)
      temp += 1;
    else if (i.first > 0 && i.second > 0)
      temp += 1;
  }
  if (temp > cnt) {
    cnt = temp;
    ans = make_pair(x, y + 1);
  }
  temp = 0;
  for (auto i : arr) {
    if (i.second < 0 && i.first == 0)
      temp += 1;
    else if (i.first < 0 && i.second < 0)
      temp += 1;
    else if (i.first > 0 && i.second < 0)
      temp += 1;
  }
  if (temp > cnt && y - 1 >= 0) {
    cnt = temp;
    ans = make_pair(x, y - 1);
  }
  cout << cnt << '\n';
  cout << ans.first << " " << ans.second << '\n';
}
