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, s1,s2 = map(int, input().split())

# n, s1, s2 = 7, 10, 12
# p = [(5, 6),(20, 23),(15, 4),(16, 5),(4, 54),(12, 1),(4, 15)]



# n ,s1, s2 = 3, 100, 100
# p = [(0,0), (0,0), (101, 200)]

# n ,s1, s2 = 4, 3,2
# p = [(1,3), (4,2), (5, 1),(4,1)]


count = [0, 0, 0, 0]
min_point = [[0,0], [0,0],[0,0],[0,0]]

for i in range(n):
    x, y = map(int, input().split())
    #x, y = p[i]
    
        
    if x<=s1 and y<s2:
        if count[0] == 0:
            min_point[0] = [x, y]
        count[0] += 1
        if x>=min_point[0][0]:
            min_point[0][0] = x
        if y >= min_point[0][1]:
            min_point[0][1] = y
    
    if x>s1 and y<=s2:
        if count[1] == 0:
            min_point[1] = [x, y]
        count[1] += 1
        if x<=min_point[1][0]:
            min_point[1][0] =x
        if y >= min_point[1][1]:
            min_point[1][1] = y
    
    if x>=s1 and y>s2:
        if count[2] == 0:
            min_point[2] = [x, y]
        count[2] += 1
        if x<=min_point[2][0]:
            min_point[2][0] = x
        if y<=min_point[2][1]:
            min_point[2][1] = y
    
    if x<s1 and y>=s2:
        if count[3] == 0:
            min_point[3] = [x, y]
        count[3] += 1
        if x>=min_point[3][0]:
            min_point[3][0] = x
        if y<=min_point[3][1]:
            min_point[3][1] = y
    

def check_point(start, end, pos):
    if pos[0] == end[0] and pos[1] == end[1]:
        return False
    tem1 = min(start[0], end[0]) <= pos[0] and pos[0] <= max(start[0], end[0])
    tem2 = min(start[1], end[1]) <= pos[1] and pos[1] <= max(start[1], end[1])
    return tem1 and tem2

points = []
final_count = []
for i in range(-1, 2,1):
    for j in range(-1, 2,1):
        if i==0 and j==0:
            continue
        points.append((s1+i, s2+j))
        tem = 0
        for e, p in enumerate(min_point):
            if count[e] == 0:
                continue
            if check_point(pos=[s1 + i, s2 + j], end=[s1,s2], start=p):
                tem +=count[e]
        final_count.append(tem)
                
max_idx = 0
for i in range(len(count)):
    if count[i] >= count[max_idx]:
        max_idx = i

print(final_count[max_idx])
print(*points[max_idx])
