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() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  long long i, n, x, y, val1, val2, s1 = 0, s2 = 0, s3 = 0, s4 = 0, sx1 = 0,
                                    sx2 = 0, sy1 = 0, sy2 = 0, m1, m2, m, mini;
  cin >> n >> x >> y;
  vector<pair<long long, long long> > v1, v2, v3, v4, vx1, vx2, vy1, vy2;
  for (i = 0; i < n; i++) {
    cin >> val1 >> val2;
    if (val1 == x) {
      if (val2 < y) {
        sx1++;
        vx1.push_back(make_pair(val1, val2));
      } else if (val2 > y) {
        sx2++;
        vx2.push_back(make_pair(val1, val2));
      }
    }
    if (val2 == y) {
      if (val1 < x) {
        sy1++;
        vy1.push_back(make_pair(val1, val2));
      } else if (val1 > x) {
        sy2++;
        vy2.push_back(make_pair(val1, val2));
      }
    }
    if (val1 >= x) {
      if (val2 >= y) {
        s1++;
        v1.push_back(make_pair(val1, val2));
      }
      if (val2 <= y) {
        s4++;
        v4.push_back(make_pair(val1, val2));
      }
    }
    if (val1 <= x) {
      if (val2 >= y) {
        s2++;
        v2.push_back(make_pair(val1, val2));
      }
      if (val2 <= y) {
        s3++;
        v3.push_back(make_pair(val1, val2));
      }
    }
  }
  m1 = max(s1, s3);
  m2 = max(s2, s4);
  m = max(m1, m2);
  if (m == s1) {
    if (m2 == s2) {
      cout << v1.size() + v2.size() - vx2.size() - vy1.size() << '\n';
      cout << x << ' ' << (y + 1);
    } else {
      cout << v1.size() + v4.size() - vy2.size() - vx1.size() << '\n';
      cout << (x + 1) << ' ' << y;
    }
  } else if (m == s2) {
    if (m1 == s1) {
      cout << v1.size() + v2.size() - vx2.size() - vy2.size() << '\n';
      cout << x << ' ' << (y + 1);
    } else {
      cout << v1.size() + v3.size() - vy1.size() - vx1.size() << '\n';
      cout << (x - 1) << ' ' << y;
    }
  } else if (m == s3) {
    if (m2 == s2) {
      cout << v3.size() + v2.size() - vy1.size() - vx2.size() << '\n';
      if (y == 500000074)
        cout << v3.size() << ' ' << v2.size() << ' ' << vy1.size() << ' '
             << vy2.size() << ' ' << vx1.size() << ' ' << vx2.size() << '\n';
      cout << (x - 1) << ' ' << y;
    } else {
      cout << v3.size() + v4.size() - vx1.size() - vy2.size() << '\n';
      cout << x << ' ' << (y - 1);
    }
  } else {
    if (m1 == s1) {
      cout << v4.size() + v1.size() - vy2.size() - vx2.size() << '\n';
      cout << (x + 1) << ' ' << y;
    } else {
      cout << v4.size() + v3.size() - vx1.size() - vy1.size() << '\n';
      cout << x << ' ' << (y - 1);
    }
  }
}
