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 = list(map(int, input().split()))
# students=[]

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

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

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

# for i in range(n):
#     l1, l2 = list(map(int, input().split()))
#     students.append((l1, l2))

tem = list(zip(*students))
tl = (min(tem[0]), min(tem[1]))
br = (max(tem[0]), max(tem[1]))

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

max_count = -1

for (i, j) in students:
    if i == s1 and j == s2:
        continue
    step_x = 1 if i < s1 else -1
    step_y = 1 if j < s2 else -1
    
    for x in range(i, s1+step_x, step_x):
        for y in range(j, s2+step_y, step_y):
            count = 0
            for st1, st2 in students:
                if check_point(start=(st1, st2), end=(s1, s2), pos=(x, y)):
                    count +=1

            if count > max_count:
                store_location = (x,y)
                max_count = count
    if max_count == len(students):
        print(max_count)
        print(*store_location)
        exit

print(max_count)
print(*store_location)