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>
const double PI = 3.141592653589793238;
const long long oo = 1e18;
using namespace std;
long givePaths(long x, long y, long sx, long sy, vector<long> dx,
               vector<long> dy) {
  long c = 0;
  for (long i = 0; i < dx.size(); ++i) {
    if (min(sx, dx[i]) <= x && max(sx, dx[i]) >= x && min(sy, dy[i]) <= y &&
        max(sy, dy[i]) >= y)
      c++;
  }
  return c;
}
void solve() {
  long n, sx, sy;
  cin >> n >> sx >> sy;
  vector<long> dx(n), dy(n);
  for (long i = 0; i < n; ++i) cin >> dx[i] >> dy[i];
  long rx = sx + 1, ry = sy;
  long mxc = givePaths(sx + 1, sy, sx, sy, dx, dy);
  long tmp = givePaths(sx, sy + 1, sx, sy, dx, dy);
  if (tmp > mxc) {
    mxc = tmp;
    rx = sx;
    ry = sy + 1;
  }
  tmp = givePaths(sx - 1, sy, sx, sy, dx, dy);
  if (tmp > mxc) {
    mxc = tmp;
    rx = sx - 1;
    ry = sy;
  }
  tmp = givePaths(sx, sy - 1, sx, sy, dx, dy);
  if (tmp > mxc) {
    mxc = tmp;
    rx = sx;
    ry = sy - 1;
  }
  cout << mxc << endl;
  cout << rx << " " << ry;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
