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, Sx, Sy = list(map(int, input().split()))
student_houses = [tuple(map(int, input().split())) for _ in range(n)]
from collections import defaultdict

students_SP = defaultdict(int)

S1 = []
S2 = []
S3 = []
S4 = []
for student_house in student_houses:
    if student_house[0] < Sx and student_house[1] > Sy:
        S1.append(student_house)
    elif student_house[0] < Sx and student_house[1] < Sy:
        S3.apppend(student_house)
    elif student_house[0] > Sx and student_house[1] > Sy:
        S2.append(student_house)
    else:
        S4.append(student_house)


def find_quadrant_best_location(S, Stype):
    if len(S) == 0:
        return None, None
    if len(S) == 1:
        return 1, S[0]

    maxX = None
    maxY = None
    if Stype == "S1":
        maxX = sorted(S, key=lambda x: x[0])[0]
        maxY = sorted(S, key=lambda x: x[1], reverse=True)[0]
    elif Stype == "S2":
        maxX = sorted(S, key=lambda x: x[0], reverse=True)[0]
        maxY = sorted(S, key=lambda x: x[1], reverse=True)[0]
    elif Stype == "S3":
        maxX = sorted(S, key=lambda x: x[0])[0]
        maxY = sorted(S, key=lambda x: x[1])[0]
    else:
        maxX = sorted(S, key=lambda x: x[0], reverse=True)[0]
        maxY = sorted(S, key=lambda x: x[1])[0]

    countNbInmaxX = 0
    countNbInmaxY = 0
    for house in S:
        if Stype == "S1":
            if house[1] <= maxX[1]:
                countNbInmaxX += 1
            if house[0] >= maxY[0]:
                countNbInmaxY += 1
        if Stype == "S2":
            if house[1] <= maxX[1]:
                countNbInmaxX += 1
            if house[0] <= maxY[0]:
                countNbInmaxY += 1
        if Stype == "S3":
            if house[1] >= maxX[1]:
                countNbInmaxX += 1
            if house[0] >= maxY[0]:
                countNbInmaxY += 1
        if Stype == "S4":
            if house[1] >= maxX[1]:
                countNbInmaxX += 1
            if house[0] <= maxY[1]:
                countNbInmaxY += 1

    if countNbInmaxX > countNbInmaxY:
        return countNbInmaxX, maxX
    else:
        return countNbInmaxY, maxY


results = list(map(find_quadrant_best_location, [S1, S2, S3, S4], "S1,S2,S3,S4".split(",")))
results = [x for x in results if x[0] is not None]
results_sorted = sorted(results, key=lambda x: x[0], reverse=True)
print(results_sorted[0][0])
print(" ".join(list(map(str, results_sorted[0][1]))))