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,h,k=map(int,input().split())
o=[h,k]
a=[]
for i in range(n):
	a.append(list(map(int,input().split())))
maxi=0
l=0
r=0
u=0
d=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
	elif(i[0]>=o[0]):
		if(i[0]<closer[0]):
			closer=i
		r+=1

if(r>l):
	maxi=r
	final=closer
else:
	maxi=l
	final=closel

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







