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
n,h,k=map(int,input().split())
o=[h,k]
a=[]
for i in range(n):
	a.append(list(map(int,stdin.readline().split())))
maxi=0
l=0
r=0
u=0
d=0
line=[]
left=[]
right=[]
final=[0,0]
closel=[10**9,10**9]
closer=[10**9,10**9]
for i in a:

	if(i[0]<=o[0]):
		if(i[0]<closel[0]):
			closel=i

		l+=1
		left.append(i)
	elif(i[0]>=o[0]):
		if(i[0]<closer[0]):
			closer=i
		r+=1
		right.append(i)
	else:

		line.append(i)



if(r>l):
	maxi=r
	if(closer[1]<o[1]):
		final[0]=o[0]+1
		final[1]=o[1]
	else:
		final[0]=o[0]+1
		final[1]=o[1]






else:
	maxi=l

	if(closel[1]<o[1]):
		final[0]=o[0]-1
		final[1]=o[1]
	else:
		final[0]=o[0]-1
		final[1]=o[1]
	


print(maxi)
print(final[0],final[1])







