#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int N = 1024;
const int INF = INT32_MAX;
int a[N];
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  int sx, sy;
  int v[4] = {0, 0, 0, 0};
  int maxv = INT32_MIN;
  int resx = 0, resy = 0;
  cin >> sx >> sy;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    if (x > sx) {
      v[0]++;
      if (v[0] > maxv) {
        maxv = v[0];
        resx = sx + 1, resy = sy;
      }
    }
    if (x < sx) {
      v[2]++;
      if (v[2] > maxv) {
        maxv = v[2];
        resx = sx - 1, resy = sy;
      }
    }
    if (y > sy) {
      v[1]++;
      if (v[1] > maxv) {
        maxv = v[1];
        resx = sx, resy = sy + 1;
      }
    }
    if (y < sy) {
      v[3]++;
      if (v[3] > maxv) {
        maxv = v[3];
        resx = sx, resy = sy - 1;
      }
    }
  }
  cout << maxv << "\n";
  cout << resx << " " << resy;
  return 0;
}
