#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, x, y, s1, s2, i, j, a, b, c, r = 0;
  cin >> n >> s1 >> s2;
  long long x1[n + 1], x2[n + 1], y1[n + 1], y2[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> x >> y;
    x1[i] = min(x, s1), x2[i] = max(x, s1), y1[i] = min(y, s2),
    y2[i] = max(y, s2);
  }
  vector<pair<long long, long long> > v1;
  if (s1 - 1 >= 0) v1.push_back({s1 - 1, s2});
  if (s1 + 1 <= 1e9) v1.push_back({s1 + 1, s2});
  if (s2 - 1 >= 0) v1.push_back({s1, s2 - 1});
  if (s2 + 1 <= 1e9) v1.push_back({s1, s2 + 1});
  for (i = 0; i < v1.size(); i++) {
    x = v1[i].first, y = v1[i].second, c = 0;
    for (j = 1; j <= n; j++) {
      if (x >= x1[j] && x <= x2[j] && y >= y1[j] && y <= y2[j]) c++;
    }
    if (c >= r) r = c, a = x, b = y;
  }
  cout << r << '\n';
  cout << a << " " << b << '\n';
}
