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(false);
  cin.tie(NULL);
  long long n, x, y;
  cin >> n >> x >> y;
  vector<pair<int, int>> studs(n);
  for (int i = 0; i < n; i++) cin >> studs[i].first >> studs[i].second;
  int ans = INT_MIN, coordsx, coordsy, res = 0;
  for (int i = 0; i < n; i++) {
    int dist = abs(x - studs[i].first) + abs(y - studs[i].second);
    if (dist == abs(x - studs[i].first) + abs(y + 1 - studs[i].second) + 1)
      res++;
  }
  if (ans < res) {
    ans = res;
    coordsx = x;
    coordsy = y + 1;
  }
  res = 0;
  for (int i = 0; i < n; i++) {
    int dist = abs(x - studs[i].first) + abs(y - studs[i].second);
    if (dist == abs(x - studs[i].first) + abs(y - 1 - studs[i].second) + 1) {
      res++;
    }
  }
  if (ans < res) {
    ans = res;
    coordsx = x;
    coordsy = y - 1;
  }
  res = 0;
  for (int i = 0; i < n; i++) {
    int dist = abs(x - studs[i].first) + abs(y - studs[i].second);
    if (dist == abs(x - 1 - studs[i].first) + abs(y - studs[i].second) + 1) {
      res++;
    }
  }
  if (ans < res) {
    ans = res;
    coordsx = x - 1;
    coordsy = y;
  }
  res = 0;
  for (int i = 0; i < n; i++) {
    int dist = abs(x - studs[i].first) + abs(y - studs[i].second);
    if (dist == abs(x + 1 - studs[i].first) + abs(y - studs[i].second) + 1) {
      res++;
    }
  }
  if (ans < res) {
    ans = res;
    coordsx = x + 1;
    coordsy = y;
  }
  cout << ans << endl;
  cout << coordsx << " " << coordsy << endl;
  return 0;
}
