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 + 10;
const int mod = 998244353;
int par[5], edg[5], n, x, y;
void def(int xx, int yy) {
  if (xx > x && yy > y) par[2]++;
  if (xx > x && yy < y) par[3]++;
  if (xx < x && yy > y) par[1]++;
  if (xx < x && yy < y) par[4]++;
  if (xx == x && yy > y) edg[1]++;
  if (xx == x && yy < y) edg[3]++;
  if (xx > x && yy == y) edg[2]++;
  if (xx < x && yy == y) edg[4]++;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    def(a, b);
  }
  vector<pair<int, pair<int, int>>> v;
  v.push_back({par[1] + par[2] + edg[1], {x, y + 1}});
  v.push_back({par[2] + par[3] + edg[2], {x + 1, y}});
  v.push_back({par[4] + par[3] + edg[3], {x, y - 1}});
  v.push_back({par[1] + par[4] + edg[4], {x - 1, y}});
  sort(v.begin(), v.end());
  cout << v[3].first << endl
       << v[3].second.first << " " << v[3].second.second << endl;
}
