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
from sys import stdin,stdout
from bisect import bisect_right as br
from bisect import bisect_left as bl 
from math import gcd
x=[]
y=[]
n,sx,sy=map(int,stdin.readline().split())
for i in range(n):
    xi,yi=map(int,stdin.readline().split())
    x+=[xi]
    y+=[yi]
x.sort()
y.sort()
a=br(x,sx-1)
b=len(x)-bl(x,sx+1)
c=br(y,sy-1)
d=len(y)-bl(y,sy+1)
ans=max(a,b,c,d)
if ans==a:
    ansx=sx-1
    ansy=sy
if ans==b:
    ansx=sx+1
    ansy=sy
if ans==c:
    ansx=sx
    ansy=sy-1
if ans==d:
    ansx=sx
    ansy=sy+1
stdout.write(str(ans)+'\n')
stdout.write(str(ansx)+' '+str(ansy))