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 ll = long long;
using vl = vector<ll>;
using vi = vector<int>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using ppii = pair<pi, int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpil = vector<pil>;
using vpli = vector<pli>;
using vppii = vector<ppii>;
using si = set<int>;
using sl = set<ll>;
using spi = set<pi>;
int main() {
  int n;
  cin >> n;
  ll x, y, s, t;
  cin >> x;
  cin >> y;
  int l = 0, u = 0, d = 0, r = 0;
  for (int i = 0; i != n; ++i) {
    cin >> s >> t;
    if (s > x) {
      r++;
    }
    if (s < x) {
      l++;
    }
    if (t > y) {
      u++;
    }
    if (t < y) {
      d++;
    }
  }
  ll a = x - 1;
  ll b = y;
  if (r > l) {
    a += 2;
    l = r;
  }
  if (d > l) {
    a = x;
    b = y - 1;
    l = d;
  }
  if (u > l) {
    a = x;
    b = y + 1;
    l = u;
  }
  cout << l << endl;
  cout << a << " " << b;
}
