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;
signed main() {
  long long n, sx, sy;
  cin >> n >> sx >> sy;
  long long ul = 0, ur = 0, dl = 0, dr = 0, u = 0, d = 0, l = 0, r = 0;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    if (x == sx) {
      if (y < sy)
        u++;
      else
        d++;
    } else if (x < sx) {
      if (y == sy)
        l++;
      else if (y < sy)
        ul++;
      else
        dl++;
    } else {
      if (y == sy)
        r++;
      else if (y < sy)
        ur++;
      else
        dr++;
    }
  }
  vector<long long> ans(4, -1);
  long long max_ans = -1, max_idx = -1;
  if (sy - 1 >= 0) {
    ans[0] = ul + u + ur;
    if (ans[0] > max_ans) max_ans = ans[0], max_idx = 0;
  }
  if (sy + 1 <= 1000000000) {
    ans[1] = dl + dr + d;
    if (ans[1] > max_ans) max_ans = ans[1], max_idx = 1;
  }
  if (sx - 1 >= 0) {
    ans[2] = ul + dl + l;
    if (ans[2] > max_ans) max_ans = ans[2], max_idx = 2;
  }
  if (sx + 1 <= 1000000000) {
    ans[3] = ur + dr + r;
    if (ans[3] > max_ans) max_ans = ans[3], max_idx = 3;
  }
  cout << max_ans << endl;
  if (max_idx == 0)
    cout << sx << " " << sy - 1 << endl;
  else if (max_idx == 1)
    cout << sx << " " << sy + 1 << endl;
  else if (max_idx == 2)
    cout << sx - 1 << " " << sy << endl;
  else
    cout << sx + 1 << " " << sy << endl;
}
