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 = 2e5 + 5;
const int mod = 1e9 + 7;
struct node {
  int x, y;
} a[N];
int ans, ax, ay, ans2, ax2, ay2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, sx, sy;
  cin >> n >> sx >> sy;
  for (int i = 1; i <= n; i++) cin >> a[i].x >> a[i].y;
  int cnt = 0, res = -1, fres = 1000000005, p, q;
  for (int i = 1; i <= n; i++) {
    if (a[i].x < sx) {
      if (a[i].x > res) {
        res = a[i].x;
        p = i;
      }
      cnt++;
    } else {
      if (a[i].x < fres) {
        fres = a[i].x;
        q = i;
      }
    }
  }
  if (cnt >= n - cnt) {
    ans = cnt;
    ax = a[p].x;
    ay = sy;
  } else {
    ans = n - cnt;
    ax = a[q].x;
    ay = sy;
  }
  cnt = 0, res = -1, fres = 1000000005;
  for (int i = 1; i <= n; i++) {
    if (a[i].y < sy) {
      if (a[i].y > res) {
        res = a[i].y;
        p = i;
      }
      cnt++;
    } else {
      if (a[i].y < fres) {
        fres = a[i].y;
        q = i;
      }
    }
  }
  if (cnt >= n - cnt) {
    ans2 = cnt;
    ax2 = sx;
    ay2 = a[p].y;
  } else {
    ans2 = n - cnt;
    ax2 = sx;
    ay2 = a[q].y;
  }
  if (ans > ans2) {
    cout << ans << endl;
    cout << ax << " " << ay << endl;
  } else {
    cout << ans2 << endl;
    cout << ax2 << " " << ay2 << endl;
  }
  return 0;
}
