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


def read():
    n, x, y = map(int, input().split())
    a = [tuple(map(int, input().split())) for _ in range(n)]
    return n, a, x, y


def solve(n, a, x, y):
    c1, c2, c3, c4 = 0, 0, 0, 0
    for ai in a:
        dx = ai[0] - x
        dy = ai[1] - y
        c1 += 1 if dx >= 0 else 0
        c2 += 1 if dy >= 0 else 0
        c3 += 1 if dx <= 0 else 0
        c4 += 1 if dy <= 0 else 0

    if c1 >= c2 and c1 >= c3 and c1 >= c4:
        return x + 1, y
    elif c2 >= c1 and c2 >= c3 and c2 >= c4:
        return x, y + 1
    elif c3 >= c1 and c3 >= c2 and c3 >= c4:
        return x - 1, y
    elif c4 >= c1 and c4 >= c2 and c4 >= c3:
        return x, y - 1


result = solve(*read())
print(*result)


# noinspection PyShadowingBuiltins
def input():
    return stdin.readline().rstrip("\r\n")
