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;
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;
}
