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,xs,ys=[int(element) for element in input().split(" ")]

liste=[]
for iteration in range(n):
    x,y=[int(element) for element in input().split(" ")]
    liste.append( (x,y) )
SE1,SE2,SW1,SW2,NE1,NE2,NW1,NW2=[0 for i in range(8)]
for (x,y) in liste:
    if x>xs and y<=ys:
        SE1+=1
    elif x>=xs and y<ys:
        SE2+=1
    elif x<xs and y <=ys:
        SW1+=1
    elif x>=xs and y<ys:
        SW2+=1
    elif x<xs and y>=ys:
        NW1+=1
    elif x<=xs and y>ys:
        NW2+=1
    elif x>xs and y>=ys:
        NE1+=1
    else:
        NE2+=1

m=max(SE1,SE2,SW1,SW2,NE1,NE2,NW1,NW2)

if SE1==m or NE1==m:
    answer=(xs+1,ys)
elif SE2==m or SW2==m:
    answer=(xs,ys-1)
elif SW1==m or NW1==m:
    answer=(xs-1,ys)
elif NW2==m or NE2==m:
    answer=(xs,ys+1)

x,y=answer

print(str(m)+'\n'+str(x)+' '+str(y))