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;
const int MOD = 1e9 + 7;
const int N = 3e5 + 6;
int main() {
  int64_t n;
  cin >> n;
  int64_t x, y;
  cin >> x >> y;
  vector<pair<int64_t, int64_t>> v;
  for (int64_t i = 0; i < n; i++) {
    int64_t xx, yy;
    cin >> xx >> yy;
    v.push_back(make_pair(xx, yy));
  }
  int64_t ans = 0;
  int64_t b[5] = {0};
  for (int64_t i = 0; i < n; i++) {
    if (v[i].first <= x) ans++;
  }
  b[1] = ans;
  ans = 0;
  for (int64_t i = 0; i < n; i++) {
    if (v[i].first >= x) ans++;
  }
  b[2] = ans;
  ans = 0;
  for (int64_t i = 0; i < n; i++) {
    if (v[i].second <= y) ans++;
  }
  b[3] = ans;
  ans = 0;
  for (int64_t i = 0; i < n; i++) {
    if (v[i].second >= y) ans++;
  }
  b[4] = ans;
  int64_t ma = max({b[1], b[2], b[3], b[4]});
  cout << ma << "\n";
  if (ma == b[1])
    cout << x - 1 << " " << y;
  else if (ma == b[2])
    cout << x + 1 << " " << y;
  else if (ma == b[3])
    cout << x << " " << y - 1;
  else
    cout << x << " " << y + 1;
  return 0;
}
