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;
const int N = 1e6 + 5;
int n, a, b;
int cx[] = {1, 0, -1, 0}, cy[] = {0, 1, 0, -1};
pair<int, int> Point[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; ++i) cin >> Point[i].first >> Point[i].second;
  int uu = 0;
  int ans = -1;
  for (int dir = 0; dir < 4; ++dir) {
    int res = 0, u = a + cx[dir], v = b + cy[dir];
    for (int i = 1; i <= n; ++i) {
      if (dir == 0 && a < u && u <= Point[i].first) res++;
      if (dir == 1 && b < v && v <= Point[i].second) res++;
      if (dir == 2 && a > u && u >= Point[i].first) res++;
      if (dir == 3 && b > v && v >= Point[i].second) res++;
    }
    if (ans < res) {
      ans = res;
      uu = dir;
    }
  }
  cout << ans << '\n';
  cout << a + cx[uu] << ' ' << b + cy[uu];
  return 0;
}
