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, gettrace


def input():
    return stdin.buffer.readline()

t, x, y = map(int, input().split())
quarters = [0]*4
borders = [0]*4
for i in range(t):
    tx, ty = map(int, input().split())
    if tx < x and ty < y:
        quarters[0] += 1
    elif tx > x and ty < y:
        quarters[1] += 1
    elif tx > x and ty > y:
        quarters[2] +=1
    elif tx < x and ty > y:
        quarters[3] += 1
    elif tx==x and ty <y:
        borders[0] += 1
    elif tx>x and ty==y:
        borders[1] += 1
    elif tx==x and ty>y:
        borders[2] += 1
    elif tx<x and ty==y:
        borders[3] += 1

max_i = 0
max = -float('inf')
quarters.append(quarters[0])
# print(quarters)
# print(borders)
for i in range(4):
    val_i = quarters[i] + quarters[i+1] + borders[i]
    if val_i > max:
        max = val_i
        max_i = i

positions = [(x, y-1), (x+1, y), (x, y+1), (x-1, y)]
print(max)
print(*positions[max_i])

