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;
void Main();
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Main();
}
pair<int, int> v[200005];
void Main() {
  int n, x, y;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  int ans = -1, typ = -1;
  for (int i = 0, cnt = 0; i < n; i++) {
    if (v[i].first <= x - 1) {
      cnt++;
    }
    if (cnt > ans) {
      ans = cnt;
      typ = 1;
    }
  }
  for (int i = 0, cnt = 0; i < n; i++) {
    if (v[i].first >= x + 1) {
      cnt++;
    }
    if (cnt > ans) {
      ans = cnt;
      typ = 2;
    }
  }
  for (int i = 0, cnt = 0; i < n; i++) {
    if (v[i].second <= y - 1) {
      cnt++;
    }
    if (cnt > ans) {
      ans = cnt;
      typ = 3;
    }
  }
  for (int i = 0, cnt = 0; i < n; i++) {
    if (v[i].second >= y + 1) {
      cnt++;
    }
    if (cnt > ans) {
      ans = cnt;
      typ = 4;
    }
  }
  if (typ == 1) {
    x--;
  } else if (typ == 2) {
    x++;
  } else if (typ == 3) {
    y--;
  } else {
    y++;
  }
  cout << ans << "\n";
  cout << x << " " << y << "\n";
}
