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,x,y=map(int,input().split())
mp={}
if(x-1>=0):
    mp[(x-1,y)]=0
if(y-1>=0):
    mp[(x,y-1)]=0
mp[(x+1,y)]=0
mp[(x,y+1)]=0
ma=0
for _ in range(n):
    u,v=map(int,input().split())
    if(u<x):
        if((x-1,y) in mp):
            mp[(x-1,y)]+=1
            ma=max(ma,mp[(x-1,y)])
        
    if(u>x):
        mp[(x+1,y)]+=1
        ma=max(ma,mp[(x+1,y)])
        
    if(v>y):
        mp[(x,y+1)]+=1
        ma=max(mp[(x,y+1)],ma)
    if(v<y):
        if((x,y-1) in mp):
            mp[(x,y-1)]+=1
            ma=max(ma,mp[(x,y-1)])
print(ma)
if(ma==mp[(x,y+1)]):
    print(x,y+1)
elif(ma==mp[(x+1,y)]):
    print(x+1,y)
elif((x-1,y) in mp and ma==mp[(x-1,y)]):
    print(x-1,y)
else:
    print(x,y-1)
    
    
