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
def horizontal(h, s):
    return h[1] == s[1]


def vertical(h, s):
    return h[0] == s[0]


n, s_x, s_y = map(int, input().split())
s = [s_x, s_y]
houses = []
for i in range(n):
    x, y = map(int, input().split())
    houses.append([x, y])

# n = 7
# s = [10, 12]
# houses = [[5, 6], [20, 23], [15, 4], [16, 5], [4, 54], [12, 1], [4, 15]]

x_plus = 0
top_right = 0
y_plus = 0
top_left = 0
x_min = 0
bottom_left = 0
y_min = 0
bottom_right = 0

s_x = s[0]
s_y = s[1]

for h in houses:
    h_x = h[0]
    h_y = h[1]
    if horizontal(h, s) and h_x > s_x:
        x_plus += 1
    elif h_x > s_x and h_y > s_y:
        top_right += 1
    elif vertical(h, s) and h_y > s_y:
        y_plus += 1
    elif h_x < s_x and h_y > s_y:
        top_left += 1
    elif horizontal(h, s) and h_x < s_x:
        x_min += 1
    elif h_x < s_x and h_y < s_y:
        bottom_left += 1
    elif vertical(h, s) and h_y < s_y:
        y_min += 1
    elif h_x > s_x and h_y < s_y:
        bottom_right += 1

right_up = x_plus + top_right
up_right = y_plus + top_right
up_left = y_plus + top_left
left_up = x_min + top_left
left_down = x_min + bottom_left
down_left = y_min + bottom_left
down_right = y_min + bottom_right
right_down = x_plus + bottom_right

most_houses = max(right_up, up_right, up_left, left_up, left_down, down_left, down_right, right_down)
print(most_houses)
if most_houses == right_up or most_houses == right_down:
    print(s_x + 1, s_y)
elif most_houses == up_right or most_houses == up_left:
    print(s_x, s_y + 1)
elif most_houses == left_up or most_houses == left_down:
    print(s_x - 1, s_y)
elif most_houses == down_left or most_houses == down_right:
    print(s_x, s_y - 1)
