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;
int main() {
  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 = -1; i <= 1; i += 2) {
    for (j = -1; j <= 1; j += 2) {
      sum = 0;
      a1 = a + i;
      b1 = b + j;
      for (k = 0; k < n; k++) {
        if (a1 <= max(a, x[k]) && a1 >= min(a, x[k]) && b1 <= max(b1, y[k]) &&
            b1 >= min(b1, y[k]))
          sum++;
      }
      if (sum > tot) {
        tot = sum;
        t1 = a1;
        t2 = b1;
      }
    }
  }
  cout << tot << "\n";
  cout << t1 << " " << t2;
  return 0;
}
