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
def main():
    n, s1, s2 = map(int, input().split())
    part = [0, 0, 0, 0]
    lines = [0, 0, 0, 0]
    for i in range(n):
        a, b = map(int, input().split())
        if a == s1:
            if b < s2:
                lines[0] += 1
            if b > s2:
                lines[2] += 1
        if b == s2:
            if a < s1:
                lines[1] += 1
            if a > s1:
                lines[3] += 1

        if a < s1:
            if b < s2:
                part[0] += 1
            if b > s2:
                part[1] += 1
        if a > s1:
            if b < s2:
                part[2] += 1
            if b > s2:
                part[3] += 1

    part[3] += max(lines[2], lines[3])
    part[2] += max(lines[0], lines[3])
    part[1] += max(lines[2], lines[1])
    part[3] += max(lines[0], lines[1])
    print(max(part))
    if max(part) == part[3]:
        if max(lines[2], lines[3]) == lines[2]:
            print(s1, s2 + 1)
        else:
            print(s1 + 1, s2)
    elif max(part) == part[2]:
        if max(lines[0], lines[3]) == lines[0]:
            print(s1, s2 - 1)
        else:
            print(s1 + 1, s2)
    elif max(part) == part[1]:
        if max(lines[2], lines[1]) == lines[2]:
            print(s1, s2 + 1)
        else:
            print(s1 - 1, s2)
    elif max(part) == part[0]:
        if max(lines[0], lines[1]) == lines[1]:
            print(s1 - 1, s2)
        else:
            print(s1, s2 - 1)


if __name__ == '__main__':
    t = 1
    for i in range(t):
        main()
