#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, n, i, j, k, a, b, tot, a1, b1, sum, t1, t2;
  cin >> n >> a >> b;
  long long x[n], y[n];
  for (i = 0; i < n; i++) cin >> x[i] >> y[i];
  tot = 0;
  for (i = a - 1; i <= a + 1; i += 2) {
    sum = 0;
    a1 = i;
    b1 = b;
    for (k = 0; k < n; k++) {
      if (a1 <= max(a, x[k]) && a1 >= min(a, x[k]) && b1 <= max(b, y[k]) &&
          b1 >= min(b, y[k]))
        sum++;
    }
    if (sum > tot) {
      tot = sum;
      t1 = a1;
      t2 = b1;
    }
  }
  for (i = b - 1; i <= b + 1; i += 2) {
    sum = 0;
    a1 = a;
    b1 = i;
    for (k = 0; k < n; k++) {
      if (a1 <= max(a, x[k]) && a1 >= min(a, x[k]) && b1 <= max(b, y[k]) &&
          b1 >= min(b, y[k]))
        sum++;
    }
    if (sum > tot) {
      tot = sum;
      t1 = a1;
      t2 = b1;
    }
  }
  cout << tot << "\n";
  cout << t1 << " " << t2;
  return 0;
}
