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;
bool isPrime(int n) {
  if (n <= 1) return 0;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
long long int min(long long int a, long long int b) {
  if (a > b)
    return b;
  else
    return a;
}
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, sx, sy, x, y, l = 0, r = 0, k = 0;
  cin >> n >> sx >> sy;
  vector<pair<long long int, long long int>> v;
  long long int a[4] = {0};
  for (long long int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  vector<pair<long long int, long long int>> p;
  l = sx - 1;
  r = sy;
  p.push_back(make_pair(l, r));
  for (long long int i = 0; i < n; i++) {
    if ((l >= min(v[i].first, sx) && l <= max(v[i].first, sx)) &&
        (r >= min(v[i].second, sy) && r <= max(v[i].second, sy)))
      a[0]++;
  }
  l = sx;
  r = sy + 1;
  p.push_back(make_pair(l, r));
  for (long long int i = 0; i < n; i++) {
    if ((l >= min(v[i].first, sx) && l <= max(v[i].first, sx)) &&
        (r >= min(v[i].second, sy) && r <= max(v[i].second, sy)))
      a[1]++;
  }
  l = sx + 1;
  r = sy;
  p.push_back(make_pair(l, r));
  for (long long int i = 0; i < n; i++) {
    if ((l >= min(v[i].first, sx) && l <= max(v[i].first, sx)) &&
        (r >= min(v[i].second, sy) && r <= max(v[i].second, sy)))
      a[2]++;
  }
  l = sx;
  r = sy - 1;
  p.push_back(make_pair(l, r));
  for (long long int i = 0; i < n; i++) {
    if ((l >= min(v[i].first, sx) && l <= max(v[i].first, sx)) &&
        (r >= min(v[i].second, sy) && r <= max(v[i].second, sy)))
      a[3]++;
  }
  long long int ans = a[0];
  for (long long int i = 0; i < 4; i++) {
    if (a[i] >= ans) {
      ans = a[i];
      k = i;
    }
  }
  cout << ans << "\n";
  cout << p[k].first << " " << p[k].second << "\n";
}
