#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long arr[200005];
pair<long long, long long> pt[200005];
int main() {
  long long n, x, y, newX, newY, cnt = 0, ansX, ansY, val = 0;
  map<pair<long long, long long>, long long> mp1;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    cin >> pt[i].first >> pt[i].second;
  }
  newX = x + 1, newY = y;
  for (int i = 0; i < n; i++) {
    if (newX >= min(pt[i].first, x) and newX <= max(pt[i].first, x)) {
      if (newY >= min(pt[i].second, y) and newY <= max(pt[i].second, y)) cnt++;
    }
  }
  mp1[{newX, newY}] = cnt;
  cnt = 0;
  newX = x - 1, newY = y;
  for (int i = 0; i < n; i++) {
    if (newX >= min(pt[i].first, x) and newX <= max(pt[i].first, x)) {
      if (newY >= min(pt[i].second, y) and newY <= max(pt[i].second, y)) cnt++;
    }
  }
  mp1[{newX, newY}] = cnt;
  cnt = 0;
  newX = x, newY = y + 1;
  for (int i = 0; i < n; i++) {
    if (newX >= min(pt[i].first, x) and newX <= max(pt[i].first, x)) {
      if (newY >= min(pt[i].second, y) and newY <= max(pt[i].second, y)) cnt++;
    }
  }
  mp1[{newX, newY}] = cnt;
  cnt = 0;
  newX = x, newY = y - 1;
  for (int i = 0; i < n; i++) {
    if (newX >= min(pt[i].first, x) and newX <= max(pt[i].first, x)) {
      if (newY >= min(pt[i].second, y) and newY <= max(pt[i].second, y)) cnt++;
    }
  }
  mp1[{newX, newY}] = cnt;
  for (auto it = mp1.begin(); it != mp1.end(); it++) {
    if (it->second > val) {
      val = it->second;
      ansX = it->first.first;
      ansY = it->first.second;
    }
  }
  cout << val << endl;
  cout << ansX << " " << ansY << endl;
}
