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
import math
from collections import Counter


if __name__ == '__main__':
    n_students, school_x, school_y = map(int, input().split())
    houses = []

    dict = {
        'RIGHT' : 0,
        'LEFT' : 0,
        'UP' : 0,
        'DOWN' : 0
    }

    for i in range(n_students):
        x, y = map(int, input().split())
        if x > school_x:
            dict['RIGHT'] += 1
        elif x < school_x:
            dict['LEFT'] += 1


        if y > school_y:
            dict['UP'] += 1
        elif y < school_y:
            dict['DOWN'] += 1

    max_direction = max(dict, key=dict.get)
    max_elem = dict[max_direction]

    print("LINE:31 -- max = " + str(max_direction))
    print("LINE:33 -- max_elem = " + str(max_elem))


    # x_axis_occurance = Counter(x_relative_list)
    # y_axis_occurance = Counter(y_relative_list)
    #
    # x_axis_mst_cmn = x_axis_occurance.most_common(1)[0]
    # y_axis_mst_cmn = y_axis_occurance.most_common(1)[0]
    #
    # most_common = max(x_axis_mst_cmn[1], y_axis_mst_cmn[1])
    #
    # print(most_common)
    # if x_axis_mst_cmn[1] > y_axis_mst_cmn[1]:
    #     print(str(school_x + x_axis_mst_cmn[0]) + ' ' + str(school_y))
    # else:
    #     print(str(school_x) + ' ' + str(school_y + y_axis_mst_cmn[0]))

    print(max_elem)
    if max_direction == 'LEFT':
        print(str(school_x - 1) + ' ' + str(school_y))
    if max_direction == 'RIGHT':
        print(str(school_x + 1) + ' ' + str(school_y))
    if max_direction == 'UP':
        print(str(school_x) + ' ' + str(school_y + 1))
    if max_direction == 'DOWN':
        print(str(school_x) + ' ' + str(school_y - 1))


