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
from sys import stdin, stdout
#import math
from collections import deque

input = stdin.readline

asdf = [int(x) for x in input().split(' ')]
n = asdf[0]
skoolx = asdf[1]
skooly = asdf[2]
l = 0
r = 0
u = 0
d = 0

for i in range(n):
    li = [int(x) for x in input().split(' ')]
    if li[0] < skoolx: l += 1
    elif li[0] > skoolx: r += 1
    if li[1] < skooly: d += 1
    elif li[1] > skooly: u += 1
    
best = max([l,r,u,d])
if best == l: print(str(skoolx - 1) + ' ' + str(skooly))
elif best == r: print(str(skoolx + 1) + ' ' + str(skooly))
elif best == u: print(str(skoolx) + ' ' + str(skooly + 1))
else: print(str(skoolx) + ' ' + str(skooly - 1))