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
def check(x,y):
    if y>=x-c and y>=c-x:
        return 'down'
    elif y>=x-c and y<=c-x:
        return "left"
    elif y<=x-c and y>=c-x:
        return "right"
    else:
        return "up"

n,sx,sy = list(map(int,input().split()))
right = 0
left = 0
up = 0
down = 0

c = (-1)*(sx-sy)


for i in range(n):
    x,y = list(map(int,input().split()))
    if check(x,y)=="right":
        right+=1
    if check(x,y)=="left":
        left+=1
    if check(x,y)=="up":
        up+=1
    if check(x,y)=="down":
        down+=1
        

m = max(right,left,up,down)
print(right,left,up,down)
print(m)
if m==right:
    print(sx+1,sy)
    
elif m==left:
    print(sx-1,sy)
elif m==down:
    print(sx,sy-1)
else:
    print(sx,sy+1)