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 fun(vector<long long int> v1, vector<long long int> v2, long long int n,
         long long int sum, long long int p, long long int j, long long int sx,
         long long int sy) {
  long long int i, d = 0, c = 0;
  d = n - sum;
  if (sum > d) {
    cout << sum << "\n";
    if (p == 1)
      cout << sx << " " << sy - 1;
    else
      cout << sx - 1 << " " << sy;
  } else {
    cout << d << "\n";
    if (j == 1)
      cout << sx + 1 << " " << sy;
    else
      cout << sx << " " << sy + 1;
  }
  cout << "\n";
  return;
}
int main() {
  long long int t, n, k, i, j, p, sum;
  long long int sx, sy;
  cin >> n >> sx >> sy;
  vector<long long int> v1(n);
  vector<long long int> v2(n);
  sum = 0;
  p = 0;
  j = 0;
  for (i = 0; i < n; i++) {
    cin >> v1[i] >> v2[i];
    if (v1[i] < sx) sum++;
    if (v1[i] == sx) p = 1;
    if (v2[i] == sy) j = 1;
  }
  fun(v1, v2, n, sum, p, j, sx, sy);
  v1.clear();
  v2.clear();
  return 0;
}
