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;
template <class T>
bool umin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool umax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
long long POW(long long a, long long p, long long M) {
  if (!p) return 1LL;
  long long T = POW(a, p / 2, M);
  T = T * T % M;
  if (p & 1) T = T * (a % M) % M;
  return T;
}
long long SQRT(long long a) {
  long long b = (long long)sqrtl(((double)a) + 0.5);
  while (b * b < a) ++b;
  while (b * b > a) --b;
  return (b * b == a) ? b : -1;
}
const long long MOD = 1e9 + 7;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  long long s[2];
  long long n;
  cin >> n;
  cin >> s[0] >> s[1];
  vector<pair<long long, long long>> vv(n);
  for (long long i = 0; i < n; i++) cin >> vv[i].first >> vv[i].second;
  long long f = 0;
  long long ff[2];
  for (long long i = 0; i < 2; i++)
    for (long long j = -1; j <= 1; j += 2) {
      long long fff[2];
      fff[0] = s[0];
      fff[1] = s[1];
      fff[i] += j;
      if (fff[0] >= 0 && fff[1] >= 0 && fff[0] <= 1e9 && fff[1] <= 1e9) {
        long long xf = 0;
        for (long long x = 0; x < n; x++) {
          if (fff[0] >= min(vv[x].first, s[0]) &&
              fff[0] <= max(vv[x].first, s[0]) &&
              fff[1] >= min(vv[x].second, s[1]) &&
              fff[1] <= max(vv[x].second, s[1]))
            xf++;
        }
        if (xf > f) {
          f = xf;
          ff[0] = fff[0];
          ff[1] = fff[1];
        }
      }
    }
  cout << f << endl;
  cout << ff[0] << " " << ff[1] << endl;
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  return 0;
}
