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;
const int N = 2e5 + 1;
const int mx = 1e9;
int n, ans = 0;
pair<int, int> cap, ans1 = {0, 0};
pair<pair<int, int>, pair<int, int> > a[N];
bool chk(pair<int, int> x) {
  return 1 <= x.first && x.first <= mx && 1 <= x.second && x.second <= mx;
}
bool In(int x, int l, int r) { return l <= x && x <= r; }
void process(pair<int, int> x) {
  if (!chk(x)) return;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i].first.first <= x.first && x.first <= a[i].second.first &&
        a[i].first.second <= x.second && x.second <= a[i].second.second)
      cnt++;
  }
  if (cnt > ans) {
    ans = cnt;
    ans1 = x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> cap.first >> cap.second;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first.first >> a[i].first.second;
    a[i].second = cap;
    if (a[i].first.first > a[i].second.first)
      swap(a[i].first.first, a[i].second.first);
    if (a[i].first.second > a[i].second.second)
      swap(a[i].first.second, a[i].second.second);
  }
  pair<int, int> x;
  for (int i = -1; i <= 1; i++) {
    for (int j = -1; j <= 1; j++) {
      if (i == 0 && j == 0) continue;
      process({cap.first + i, cap.second + j});
    }
  }
  cout << ans << '\n';
  cout << ans1.first << " " << ans1.second << '\n';
}
