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;
void swap(long long &a, long long &b) {
  auto tm = a;
  a = b;
  b = tm;
}
const long long mod = 1000000007;
const long long mod2 = 998244353;
const long long INF = (1LL << 50) - 1;
const long long N = 2e5 + 25;
void bheja_fry() {
  long long n, x, y;
  cin >> n >> x >> y;
  vector<pair<long long, long long> > v(n);
  for (long long(i) = (0); (i) < (n); ++(i)) cin >> v[i].first >> v[i].second;
  vector<long long> a(8);
  vector<pair<long long, long long> > b{{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
  for (auto &(i) : (v)) {
    if (i.first > x && i.second > y)
      a[0]++;
    else if (i.first < x && i.second > y)
      a[1]++;
    else if (i.first < x && i.second < y)
      a[2]++;
    else if (i.first > x && i.second < y)
      a[3]++;
    else if (i.second == y && i.first > x)
      a[4]++;
    else if (i.first == x && i.second > y)
      a[5]++;
    else if (i.second == y && i.first < x)
      a[6]++;
    else
      a[7]++;
  }
  vector<long long> c(4);
  c[0] = a[0] + a[4] + a[3];
  c[1] = a[1] + a[5] + a[0];
  c[2] = a[1] + a[6] + a[2];
  c[3] = a[2] + a[7] + a[3];
  long long mx = 0, xx = 0, yy = 0;
  for (long long(i) = (0); (i) < (4); ++(i)) {
    if (mx < c[i]) {
      mx = c[i];
      xx = b[i].first;
      yy = b[i].second;
    }
  }
  cout << mx << "\n" << x + xx << " " << y + yy;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long(i) = (1); (i) < (t + 1); ++(i)) {
    bheja_fry();
    if (i < t) cout << "\n";
  }
  return 0;
}
