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;
int a, b, c, d, e, f;
int sx, sy;
int main() {
  cin >> a >> sx >> sy;
  for (int i = 1; i <= a; i++) {
    int x, y;
    cin >> x >> y;
    if (x > sx) {
      c++;
    }
    if (x < sx) {
      d++;
    }
    if (y < sy) e++;
    if (y > sy) f++;
  }
  if (max({c, d, e, f}) == c) {
    cout << sx + 1 << " " << sy;
  } else if (max({c, d, e, f}) == d) {
    cout << sx - 1 << " " << sy;
  } else if (max({c, d, e, f}) == e) {
    cout << sx << " " << sy - 1;
  } else {
    cout << sx << " " << sy + 1;
  }
}
