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 maxn = 3000 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  int n, sx, sy;
  cin >> n >> sx >> sy;
  vector<int> px, py;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    px.push_back(x);
    py.push_back(x);
  }
  sort(px.begin(), px.end());
  sort(py.begin(), py.end());
  int ans = 0, ansx = 0, ansy = 0;
  int idx = lower_bound(px.begin(), px.end(), sx) - px.begin();
  if (ans < idx) {
    ans = idx;
    ansx = sx - 1, ansy = sy;
  }
  idx = n - (upper_bound(px.begin(), px.end(), sx) - px.begin());
  if (ans < idx) {
    ans = idx;
    ansx = sx + 1, ansy = sy;
  }
  ans = max(ans, idx);
  idx = lower_bound(py.begin(), py.end(), sy) - py.begin();
  if (ans < idx) {
    ans = idx;
    ansx = sx, ansy = sy - 1;
  }
  idx = n - (upper_bound(py.begin(), py.end(), sy) - py.begin());
  if (ans < idx) {
    ans = idx;
    ansx = sx, ansy = sy + 1;
  }
  cout << ans << endl << ansx << " " << ansy << endl;
}
