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())
r=['-1',0]
l=['-1',0]
u=['-1',0]
d=['-1',0]
for i in range(n):
    x,y=map(int,input().split())
    if x>sx:
        if y>sy:
            r[1]+=1
            u[1]+=1
            if r[0]=='-1':
                r[0]=x
            if u[0]=='-1':
                u[0]=y
            u[0]=min(u[0],y)
            r[0]=min(r[0],x)
        elif y<sy:
            r[1]+=1
            d[1]+=1
            if r[0]=='-1':
                r[0]=x
            if d[0]=='-1':
                d[0]=y
            d[0]=max(d[0],y)
            r[0]=min(r[0],x)
        else:
            r[1]+=1
            if r[0]=='-1':
                r[0]=x
            r[0]=min(r[0],x)
    elif x<sx:
        if y>sy:
            l[1]+=1
            u[1]+=1
            if l[0]=='-1':
                l[0]=x
            if u[0]=='-1':
                u[0]=y
            u[0]=min(u[0],y)
            l[0]=max(l[0],x)
        elif y<sy:
            l[1]+=1
            d[1]+=1
            if l[0]=='-1':
                l[0]=x
            if d[0]=='-1':
                d[0]=y
            d[0]=max(d[0],y)
            l[0]=max(l[0],x)
        else:
            l[1]+=1
            if l[0]=='-1':
                l[0]=x
            l[0]=max(l[0],x)
    else:
        if y>sy:
            u[1]+=1
            if u[0]=='-1':
                u[0]=y
            u[0]=min(u[0],y)
        elif y<sy:
            d[1]+=1
            if d[0]=='-1':
                d[0]=y
            d[0]=max(d[0],y)
ans=max(r[1],l[1],u[1],d[1])
print(ans)
if r[1]==ans:
    print(r[0],sy)
elif l[1]==ans:
    print(l[0],sy)
elif u[1]==ans:
    print(sx,u[0])
elif d[1]==ans:
    print(sx,d[0])