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())
a=[]
p=[]
tx=0
ty=0
p1=[]
a1=[]
e1=0
e=0
for i in range(n):
    xi,yi=map(int,input().split())
    if xi<sx:
        p.append(xi)
    elif xi>sx:
        a.append(xi)
    else:
        e+=1
    if yi<sy:
        p1.append(yi)
    elif yi>sy:
        a1.append(yi)
    else:
        e1+=1
p.sort()
a.sort()
p1.sort()
a1.sort()
n=0
n1=0
if len(a)>len(p):
        tx=a[0]
        n+=len(a)+e
else:
        tx=p[len(p)-1]
        n+=len(p)+e1
if len(a1)>len(p1):
        ty=a1[0]
        n1+=len(a1)+e1
else:
        ty=p1[len(p1)-1]
        n1+=len(p1)+e1
print(min(n,n1))
print(tx+e," ",ty+e1)