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[3] += 1
        if a > s1:
            if b < s2:
                part[1] += 1
            if b > s2:
                part[2] += 1
    halfs = [0, 0, 0, 0]
    halfs[0] = part[0] + part[1] + lines[0]
    halfs[1] = part[1] + part[2] + lines[3]
    halfs[2] = part[2] + part[3] + lines[2]
    halfs[3] = part[3] + part[0] + lines[1]
    mx = max(halfs)

    print(mx)
    if mx == halfs[0]:
        print(s1, s2 - 1)
    elif mx == halfs[1]:
        print(s1 + 1, s2)
    elif mx == halfs[2]:
        print(s1, s2 + 1)
    elif mx == halfs[3]:
        print(s1 - 1, s2)

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