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() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  int p1, p2, p3, p4, p12, p23, p34, p41;
  p1 = p2 = p3 = p4 = p12 = p23 = p34 = p41 = 0;
  for (int i = 1; i <= n; ++i) {
    int x, y;
    cin >> x >> y;
    if (x > a && y > b) ++p1;
    if (x > a && y < b) ++p2;
    if (x < a && y < b) ++p3;
    if (x < a && y > b) ++p4;
    if (x > a && y == b) ++p12;
    if (x == a && y < b) ++p23;
    if (x < a && y == b) ++p34;
    if (x == a && y > b) ++p41;
  }
  int res = 0, coorx, coory;
  if (p1 + p12 + p2 > res) {
    res = p1 + p12 + p2;
    coorx = a + 1;
    coory = b;
  }
  if (p2 + p23 + p3 > res) {
    res = p2 + p23 + p3;
    coorx = a;
    coory = b - 1;
  }
  if (p3 + p34 + p4 > res) {
    res = p3 + p34 + p4;
    coorx = a - 1;
    coory = b;
  }
  if (p4 + p41 + p1 > res) {
    res = p4 + p41 + p1;
    coorx = a;
    coory = b + 1;
  }
  cout << res << '\n';
  cout << coorx << " " << coory;
  return 0;
}
