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
 ### @author egaeus 
 ### @mail jsbeltran.valhalla@gmail.com 
 ### @veredict 
 ### @url https://codeforces.com/problemset/problem/1271/C
 ### @category 
 ### @date 15/04/2020

from operator import itemgetter

def bs(arr, k, P):
  a = 0
  b = len(arr)
  while a < b:
    p = (a + b) // 2
    if arr[p][P] < k:
      a = p + 1
    else:
      b = p
  return a


line = input().split()
N = int(line[0])
Sx = int(line[1])
Sy = int(line[2])

arr = [[]] * N

for i in range(N):
  line = input().split()
  arr[i] = [0] * 2
  arr[i][0] = int(line[0])
  arr[i][1] = int(line[1])

sortX = sorted(arr, key=itemgetter(0, 1))
sortY = sorted(arr, key=itemgetter(1, 0))

M = 0
P = [0] * 2

for i in range(N):
  if arr[i][0] > Sx:
    search = bs(sortX, arr[i][0] - 0.5, 0)
    C = N - search
    if C > M:
      M = C
      P[0] = arr[i][0]
      P[1] = arr[i][1]
  if arr[i][0] < Sx:
    search = bs(sortX, arr[i][0] + 0.5, 0)
    C = search
    if C > M:
      M = C
      P[0] = arr[i][0]
      P[1] = arr[i][1]
  if arr[i][1] > Sy:
    search = bs(sortY, arr[i][1] - 0.5, 1)
    C = N - search
    if C > M:
      M = C
      P[0] = arr[i][0]
      P[1] = arr[i][1]
  if arr[i][1] < Sy:
    search = bs(sortY, arr[i][1] + 0.5, 1)
    C = search
    if C > M:
      M = C
      P[0] = arr[i][0]
      P[1] = arr[i][1]
  

print(M)
print(P[0], P[1])