#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 2e5;
struct node {
  int x, y;
} s[maxn];
int sx, sy;
int dir[8][2] = {1, 0, 0, 1, -1, 0, 0, -1, 1, 1, -1, -1, 1, -1, -1, 1};
int maxx = 0;
int ansx, ansy;
int n;
int cnt(int xx, int yy) {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int minx = min(sx, s[i].x);
    int miny = min(sy, s[i].y);
    int maxx = max(sx, s[i].x);
    int maxy = max(sy, s[i].y);
    if (minx <= xx && xx <= maxx && miny <= yy && yy <= maxy) {
      ans++;
    }
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  scanf("%d%d", &sx, &sy);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &s[i].x, &s[i].y);
  }
  for (int i = 0; i < 8; i++) {
    int tx = sx + dir[i][0];
    int ty = sy + dir[i][1];
    if (tx < 0 || tx > 1e9 || ty < 0 || ty > 1e9) continue;
    int num = cnt(tx, ty);
    if (num > maxx) {
      maxx = num;
      ansx = tx;
      ansy = ty;
    }
  }
  printf("%d\n", maxx);
  printf("%d %d\n", ansx, ansy);
}
