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,a,b=map(int,input().split())
graph=[]
for i in range(n):
	c,d=map(int,(input().split()))
	graph.append([c,d])
ans1=[0,a-1,b]
for i in range(n):
	if(graph[i][0]<a ):
		ans1[0]+=1
ans2=[0,a,b+1]
for i in range(n):
	if(graph[i][1]>b):
		ans2[0]+=1
ans3=[0,a+1,b]
for i in range(n):
	if(graph[i][0]>a):
		ans3[0]+=1
ans4=[0,a,b-1]
for i in range(n):
	if( graph[i][1]<b):
		ans4[0]+=1
print(max(ans1[0],ans2[0],ans3[0],ans4[0]))
if(max(ans1[0],ans2[0],ans3[0],ans4[0])==ans1[0]):
	print(ans1[1],ans1[2])
elif(max(ans1[0],ans2[0],ans3[0],ans4[0])==ans2[0]):
	print(ans2[1],ans2[2])
elif(max(ans1[0],ans2[0],ans3[0],ans4[0])==ans3[0]):
	print(ans3[1],ans3[2])
elif(max(ans1[0],ans2[0],ans3[0],ans4[0])==ans4[0]):
	print(ans4[1],ans4[2])