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;
long long power(long long a, long long b) {
  a = a % mod;
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans = (ans * a) % mod;
    }
    b = b / 2;
    a = (a * a) % mod;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(NULL));
  long long n, z, u;
  cin >> n >> z >> u;
  vector<pair<long long, long long> > vp;
  for (long long i = 0; i < n; i++) {
    long long f, s;
    cin >> f >> s;
    vp.push_back(make_pair(f, s));
  }
  long long a = z + 1;
  long long b = u;
  long long c = 0;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (abs(vp[i].first - a) + abs(vp[i].second - b) + 1 ==
        abs(vp[i].first - z) + abs(vp[i].second - u)) {
      ans++;
    }
  }
  long long t = a;
  long long j = b;
  a = z;
  b = u + 1;
  for (long long i = 0; i < n; i++) {
    if (abs(vp[i].first - a) + abs(vp[i].second - b) + 1 ==
        abs(vp[i].first - z) + abs(vp[i].second - u)) {
      c++;
    }
  }
  if (c > ans) {
    ans = c;
    t = a;
    j = b;
  }
  c = 0;
  a = z;
  b = u - 1;
  for (long long i = 0; i < n; i++) {
    if (abs(vp[i].first - a) + abs(vp[i].second - b) + 1 ==
        abs(vp[i].first - z) + abs(vp[i].second - u)) {
      c++;
    }
  }
  if (c > ans) {
    ans = c;
    t = a;
    j = b;
  }
  c = 0;
  a = z - 1;
  b = u;
  for (long long i = 0; i < n; i++) {
    if (abs(vp[i].first - a) + abs(vp[i].second - b) + 1 ==
        abs(vp[i].first - z) + abs(vp[i].second - u)) {
      c++;
    }
  }
  if (c > ans) {
    ans = c;
    t = a;
    j = b;
  }
  cout << ans << endl << t << " " << j;
}
