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;
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 u[4] = {INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN};
  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]++;
      u[0] = min(u[0], x);
      if (v[0] > maxv) {
        maxv = v[0];
        resx = u[0], resy = sy;
      }
    } else if (x < sx) {
      v[2]++;
      u[2] = max(u[2], x);
      if (v[2] > maxv) {
        maxv = v[2];
        resx = u[2], resy = sy;
      }
    } else if (y > sy) {
      v[1]++;
      u[1] = min(u[1], y);
      if (v[1] > maxv) {
        maxv = v[1];
        resx = sx, resy = u[1];
      }
    } else {
      v[3]++;
      u[3] = max(u[3], y);
      if (v[3] > maxv) {
        maxv = v[3];
        resx = sx, resy = u[3];
      }
    }
  }
  cout << maxv << "\n";
  cout << resx << " " << resy;
  return 0;
}
