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 main() {
  int n;
  long long sx, sy;
  cin >> n >> sx >> sy;
  long long a, b;
  vector<long long> x;
  vector<long long> y;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    x.push_back(a);
    y.push_back(b);
  }
  int less = 0, more = 0;
  for (int i = 0; i < n; i++) {
    if (y[i] < sy)
      less++;
    else if (y[i] > sy)
      more++;
  }
  vector<long long> c, d;
  char dd;
  if (less >= more) {
    for (int i = 0; i < n; i++) {
      if (y[i] <= sy) {
        c.push_back(x[i]);
        d.push_back(y[i]);
      }
    }
    dd = 'l';
  } else {
    for (int i = 0; i < n; i++) {
      if (y[i] >= sy) {
        c.push_back(x[i]);
        d.push_back(y[i]);
      }
    }
    dd = 'u';
  }
  int countx = 0, county = 0;
  char val;
  for (int i = 0; i < c.size(); i++) {
    if (sx == c[i])
      countx++;
    else if (sy == d[i] && sx < c[i]) {
      county++;
      val = 'r';
    } else if (sy == d[i] && sx > c[i]) {
      county++;
      val = 'l';
    }
  }
  int maxx = max(countx, county);
  int minn = min(county, countx);
  cout << c.size() - minn << endl;
  if (maxx == countx) {
    if (dd == 'u')
      cout << sx << " " << sy + 1;
    else if (dd == 'l')
      cout << sx << " " << sy - 1;
  } else {
    if (val == 'r')
      cout << sx + 1 << " " << sy;
    else if (val == 'l')
      cout << sx - 1 << " " << sy;
  }
  return 0;
}
