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())
school = (s1, s2)
# 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[3] == 0:
            min_point[2] = [x, y]
        count[3] += 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[2] == 0:
            min_point[3] = [x, y]
        count[2] += 1
        if x<=min_point[3][0]:
            min_point[3][0] = x
        if y<=min_point[3][1]:
            min_point[3][1] = y
    

p1 = min_point[0]
p2 = min_point[1]
p3 = min_point[3]
p4 = min_point[2]

p = []
c = []
p12 = [s1, max(p1[1],p2[1])]
p.append(p12)
c.append(count[0] + count[1])

p23 = [min(p2[0], p3[0]), s2]
p.append(p23)
c.append(count[1]+count[2])

p34 = [s1, min(p3[1],p4[1])]
p.append(p34)
c.append(count[2]+ count[3])

p41 = [max(p1[0],p4[0]), s2]
p.append(p41)
c.append(count[0]+ count[3])

max_idx = 0
for i in range(len(c)):
    if c[i]>= c[max_idx]:
        max_idx = i
        tent = p[i]

print(c[max_idx])
print(*p[max_idx])


