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 solve() {
  int n, sx, sy;
  cin >> n >> sx >> sy;
  int d[4] = {};
  int a, b;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    if (a != sx) d[a > sx ? 0 : 2]++;
    if (b != sy) d[b > sy ? 1 : 3]++;
  }
  int m = -1, key = -1;
  for (int i = 0; i < 4; ++i)
    if (m < d[i]) m = d[i], key = i;
  cout << m << "\n";
  if (key % 2)
    cout << sx << " " << ((key == 1) ? sy + 1 : sy - 1);
  else
    cout << ((key == 0) ? sx + 1 : sx - 1) << " " << sy;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int t = 1;
  while (t--) {
    solve();
    cout << "\n";
    cerr << "'\\n'"
         << " " << '\n'
         << "\n";
  }
}
