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;
int x[200000], y[200000];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, s[2];
  cin >> n >> s[0] >> s[1];
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  int quadrant[5] = {
      0,
  };
  int line[5] = {
      0,
  };
  for (int i = 0; i < n; i++) {
    if (x[i] > s[0] && y[i] > s[1]) quadrant[1]++;
    if (x[i] < s[0] && y[i] > s[1]) quadrant[2]++;
    if (x[i] < s[0] && y[i] < s[1]) quadrant[3]++;
    if (x[i] > s[0] && y[i] < s[1]) quadrant[4]++;
    if (x[i] > s[0] && y[i] == s[1]) line[1]++;
    if (x[i] == s[0] && y[i] > s[1]) line[2]++;
    if (x[i] < s[0] && y[i] == s[1]) line[3]++;
    if (x[i] == s[0] && y[i] < s[1]) line[4]++;
  }
  int dir[5] = {
      0,
  };
  dir[1] = quadrant[1] + quadrant[4] + line[1];
  dir[2] = quadrant[1] + quadrant[2] + line[2];
  dir[3] = quadrant[2] + quadrant[3] + line[3];
  dir[4] = quadrant[3] + quadrant[4] + line[4];
  int maxdir, maxval = 0;
  for (int i = 1; i <= 4; i++) {
    if (maxval < dir[i]) {
      maxdir = i;
      maxval = dir[i];
    }
  }
  cout << maxval << '\n';
  if (maxdir == 1)
    cout << s[0] + 1 << ' ' << s[1] << '\n';
  else if (maxdir == 2)
    cout << s[0] << ' ' << s[1] + 1 << '\n';
  else if (maxdir == 3)
    cout << s[0] - 1 << ' ' << s[1] << '\n';
  else
    cout << s[0] << ' ' << s[1] - 1 << '\n';
  return 0;
}
