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
import sys
input = sys.stdin.readline

N, Sx, Sy = map(int,input().split())
XY = [list(map(int,input().split())) for _ in range(N)]
around = [(0,1),(1,0),(0,-1),(-1,0)]
pxpy = [(Sx+dx, Sy+dy) for dx, dy in around]
cand = [0] * 4
for x, y in XY:
    k = abs(x-Sx) + abs(y-Sy)
    for t, (px, py) in enumerate(pxpy):
        i = abs(px-Sx) + abs(py-Sy)
        j = abs(x-px) + abs(y-py)
        if i + j == k:
            cand[t] += 1

c = max(cand)
px, py = pxpy[cand.index(c)]
print(c)
print(px, py)