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
MIN, MAX = 0, 10 ** 9

n, sx, sy = map(int, input().split())
a = [tuple(map(int, input().split())) for _ in range(n)]
bestX, bestY, count = -1, -1, -1
for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):
    kx, ky = sx + dx, sy + dy
    if MIN <= kx <= MAX and MIN <= ky <= MAX:
        cnt = 0
        for x, y in a:
            if dy == 1:
                cnt += y >= ky
            elif dy == -1:
                cnt += y <= ky
            elif dx == 1:
                cnt += x >= kx
            elif dx == -1:
                cnt += x <= kx
        if cnt > count:
            bestX, bestY, count = kx, ky, cnt
print('%d\n%d %d' % (count, bestX, bestY))