#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long MOD = 998244353;
double eps = 1e-12;
long long fact[250010];
long long hcf(long long p, long long q) {
  if (p > q) return hcf(q, p);
  if (!p) return q;
  return hcf(q % p, p);
}
long long lcm(long long p, long long q) { return p * q / hcf(p, q); }
long long power(long long a, long long n, long long mod) {
  long long ans = 1;
  while (n) {
    if (n % 2) ans *= a;
    a *= a;
    n /= 2;
    a %= mod;
    ans %= mod;
  }
  return ans;
}
long long fac(long long k, long long mod) {
  long long ans = 1;
  for (long long i = 1; i < k + 1; i++) {
    ans *= i;
    ans %= mod;
  }
  return ans;
}
long long binom(long long n, long long r, long long mod) {
  if (n < r) return 0;
  long long a = fact[n];
  long long b = power(fact[r], mod - 2, mod);
  long long c = power(fact[n - r], mod - 2, mod);
  a *= b;
  a %= mod;
  a *= c;
  a %= mod;
  return a;
}
void solve() {
  long long n, x, y;
  cin >> n >> x >> y;
  vector<pair<long long, long long> > a;
  for (long long i = 0; i < n; i++) {
    long long p, q;
    cin >> p >> q;
    a.push_back(make_pair(p, q));
  }
  long long X = x, Y = y + 1;
  long long ans = -1, pos1, pos2;
  if (Y <= (long long)1e9) {
    long long c = 0;
    for (long long i = 0; i < n; i++)
      if (a[i].second >= Y) c++;
    if (c > ans) {
      ans = c;
      pos1 = X;
      pos2 = Y;
    }
  }
  X = x, Y = y - 1;
  if (Y >= 0) {
    long long c = 0;
    for (long long i = 0; i < n; i++)
      if (a[i].second <= Y) c++;
    if (c > ans) {
      ans = c;
      pos1 = X;
      pos2 = Y;
    }
  }
  X = x + 1;
  Y = y;
  if (X <= (long long)1e9) {
    long long c = 0;
    for (long long i = 0; i < n; i++)
      if (a[i].first >= X) c++;
    if (c > ans) {
      ans = c;
      pos1 = X;
      pos2 = Y;
    }
  }
  X = x - 1;
  Y = y;
  if (X >= 0) {
    long long c = 0;
    for (long long i = 0; i < n; i++)
      if (a[i].first <= X) c++;
    if (c > ans) {
      ans = c;
      pos1 = X;
      pos2 = Y;
    }
  }
  cout << ans << "\n" << pos1 << " " << pos2 << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  solve();
  return 0;
}
