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;
using namespace std;
const int INF = int(1e9) + 5, mod = 1000000007, N = int(1e6) + 5;
const long long BIG = 100000000000000;
const double PI = 3.141592653589793238463;
int n, sx, sy;
pair<int, int> a[N], b[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> sx >> sy;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    b[i].first = a[i].second;
    b[i].second = a[i].first;
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + n + 1);
  int sa = n + 1;
  for (int i = 1; i <= n; i++) {
    if (a[i].first >= sx) {
      sa = i;
      break;
    }
  }
  int sb = n + 1;
  for (int i = 1; i <= n; i++) {
    if (b[i].first >= sy) {
      sb = i;
      break;
    }
  }
  int ans = 0;
  ans = max(ans, sa - 1);
  ans = max(ans, sb - 1);
  ans = max(ans, n - sa + 1);
  ans = max(ans, n - sb + 1);
  cout << ans << endl;
  if (ans == sa - 1) {
    cout << sx - 1 << " " << sy;
  } else if (ans == sb - 1) {
    cout << sx << " " << sy - 1;
  } else if (ans == n - sa + 1) {
    cout << sx + 1 << " " << sy;
  } else if (ans == n - sb + 1) {
    cout << sx << " " << sy + 1;
  }
}
