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

import bisect

n, sx, sy = [int(i) for i in input().split()]
arrx = []
arry = []
for _ in range(n):
    x, y = [int(i) for i in input().split()]
    arrx.append(x)
    arry.append(y)
arrx.sort()
arry.sort()
ans1 = [n-bisect.bisect_left(arrx, sx+1), sx+1, sy]
ans2 = [n-bisect.bisect_left(arry, sy+1), sx, sy+1]
ans3 = [bisect.bisect_left(arrx, sx-1), sx-1, sy]
ans4 = [bisect.bisect_left(arry, sy-1), sx, sy-1]


print(max(ans1, ans2, ans3, ans4)[0])
print(str(max(ans1, ans2, ans3, ans4)[1])+' '+str(max(ans1, ans2, ans3, ans4)[2]))




