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 int n, cx, cy;
  cin >> n >> cx >> cy;
  long long int pp = 0, pm = 0, mp = 0, mm = 0, same_x_d = 0, same_x_u = 0,
                same_y_r = 0, same_y_l = 0;
  for (long long int i = 0; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    if (x == cx) {
      if (y > cx)
        same_x_u++;
      else
        same_x_d++;
    } else if (y == cy) {
      if (x < cx)
        same_y_l++;
      else
        same_y_r++;
    } else if (x < cx) {
      if (y < cy)
        mm++;
      else
        mp++;
    } else if (x > cx) {
      if (y < cy)
        pm++;
      else
        pp++;
    }
  }
  long long int l = 0, r = 0, u = 0, d = 0;
  l = same_y_l + mm + mp;
  r = same_y_r + pp + pm;
  u = same_x_u + pp + mp;
  d = same_x_d + mm + pm;
  long long int ans = max(l, max(r, max(u, d)));
  cout << ans << endl;
  if (ans == l)
    cout << cx - 1 << " " << cy << endl;
  else if (ans == r)
    cout << cx + 1 << " " << cy << endl;
  else if (ans == u)
    cout << cx << " " << cy + 1 << endl;
  else if (ans == d)
    cout << cx << " " << cy - 1 << endl;
}
