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 defaultdict


def sign(x):
    if x == 0:
        return 0
    else:
        return int(math.copysign(1, x))


if __name__ == '__main__':
    n, sx, sy = map(int, input().split(' '))
    ht_pos = defaultdict(list)
    for _ in range(n):
        x, y = map(int, input().split(' '))
        ht_pos[(sign(x - sx), sign(y - sy))].append((x, y))

    max_key = (1, 1)
    max_key_len = -1
    for key in ht_pos:
        if len(ht_pos[key]) > max_key_len:
            max_key_len = len(ht_pos[key])
            max_key = key

    x_min = float('inf')
    y_min = float('inf')
    for x, y in ht_pos[max_key]:
        x_min = min(x, x_min)
        y_min = min(y, y_min)

    if len(ht_pos[(max_key[0], 0)]) > len(ht_pos[(0, max_key[1])]):
        if x_min != sx:
            max_key_len += len(ht_pos[(max_key[0], 0)])
            y_min = sy
        elif y_min != sy:
            max_key_len += len(ht_pos[(0, max_key[1])])
            x_min = sx
    else:
        if y_min != sy:
            max_key_len += len(ht_pos[(0, max_key[1])])
            x_min = sx
        elif x_min != sx:
            max_key_len += len(ht_pos[(max_key[0], 0)])
            y_min = sy

    print(max_key_len)
    print(x_min, sy)


