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;
using ll = long long;
using point = complex<double>;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const int N = 2e5 + 50;
const double EPS = 1e-8;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, y, u, v;
  vector<pair<int, int> > vec;
  vector<int> vc;
  cin >> n >> x >> y;
  for (int i = 0; i < n; ++i) {
    cin >> u >> v;
    vc.push_back(v);
    vec.push_back(make_pair(u, v));
  }
  sort(vc.begin(), vc.end());
  int ansx = -1, ansy = -1, ans = 0;
  int nx = x, ny = y - 1;
  int idx = (upper_bound(vc.begin(), vc.end(), ny) - vc.begin());
  if (idx > ans) ans = idx, ansx = nx, ansy = ny;
  nx = x, ny = y + 1;
  idx = (int)vc.size() - (lower_bound(vc.begin(), vc.end(), ny) - vc.begin());
  if (idx > ans) ans = idx, ansx = nx, ansy = ny;
  vc.clear();
  for (int i = 0; i < n; ++i) vc.push_back(vec[i].first);
  sort(vc.begin(), vc.end());
  nx = x - 1, ny = y;
  idx = (upper_bound(vc.begin(), vc.end(), nx) - vc.begin());
  if (idx > ans) ans = idx, ansx = nx, ansy = ny;
  nx = x + 1, ny = y;
  idx = (int)vc.size() - (lower_bound(vc.begin(), vc.end(), nx) - vc.begin());
  if (idx > ans) ans = idx, ansx = nx, ansy = ny;
  cout << ans << '\n';
  cout << ansx << " " << ansy << '\n';
  return 0;
}
