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

n,sx,sy=map(int,input().split())


l_left_up=0
l_left_down=0
l_right_up=0
l_right_down=0
psol,psag,pyuk,pasag=0,0,0,0

for i in range(n):
    x,y=map(int,input().split())

    if x < sx:
        if y < sx:
            l_left_down+=1
        elif y == sx:
            psol+=1
        else:
            l_left_up+=1


    elif x == sx:
        if y < sx:
            pasag+=1
        elif y == sx:
            pass
            #imp
        else:
            pyuk+=1

    else:
        if y < sx:
            l_right_down+=1
        elif y == sx:
            psag+=1
        else:
            l_right_up+=1

best=0
h=0
if l_left_up+l_left_down+psol>=best:
    best=max(best,l_left_up+l_left_down+psol)
    h=0
    #sol
if l_right_down+l_right_up+psag>=best:
    h=1
    #sag
    best=max(best,l_right_down+l_right_up+psag)
if l_right_down+l_left_down+pasag>=best:
    h=2
    #asag
    best=max(best,l_right_down+l_left_down+pasag)
if l_right_up+l_left_up+pyuk>=best:
    h=3
    #yuk
    best=max(best,l_right_up+l_left_up+pyuk)

print(best)




if h == 0:
    print(sx-1,sy)
elif h == 1:
    print(sx+1,sy)

elif h == 2:
    print(sx,sy-1)
elif h == 3:
    print(sx,sy+1)
