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
from sys import stdin
from collections import deque
mod = 10**9 + 7
# def rl():
#     return [int(w) for w in stdin.readline().split()]
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt,factorial,gcd,log2,inf,ceil
# map(int,input().split())
# # l = list(map(int,input().split()))
# from itertools import permutations

# a = int(input())
# b = int(input())
# c = int(input())
# d = int(input())
# e = int(input())
# f = int(input())
# ans = 0
#
# for i in range(d+1):
#     c = e*(min(i,a)) + f*(min(d-i,c,b))
#     ans = max(c,ans)
#     print(c,i,a)
#
# print(ans)

n,x,y = map(int,input().split())

la = []
cnt1 = []
cnt2 = []
cnt3 = []
cnt4 = []

cnt5 = []
cnt6 = []
mini1 = inf
mini2 = inf
mini3 = inf
mini4 = inf
mini5 = inf
mini6 = inf
for i in range(n):
    a,b = map(int,input().split())
    if x>=a and y>=b:
        cnt1.append([abs(x-a)+abs(y-b),a,b])
        mini1 = min(mini1,abs(x-a)+abs(y-b))
    if x>=a and b>=y:
        cnt2.append([abs(x-a)+abs(y-b),a,b])
        mini2 = min(mini2,abs(x-a)+abs(y-b))

    if x<=a and b>=y:
        cnt3.append([abs(x-a)+abs(y-b),a,b])
        mini3 = min(mini3,abs(x-a)+abs(y-b))

    if x<=a and b<=y:
        cnt4.append([abs(x-a)+abs(y-b),a,b])
        mini4 = min(mini4,abs(x-a)+abs(y-b))

    if x>a and y!=b:
        cnt5.append([abs(x-a)+abs(y-b),a,b])
        mini5 = min(mini5,abs(x-a)+abs(y-b))


    if x<a and y!=b:
        cnt6.append([abs(x-a)+abs(y-b),a,b])
        mini6 = min(mini6,abs(x-a)+abs(y-b))






z = max(len(cnt1),len(cnt2),len(cnt3),len(cnt4),len(cnt5),len(cnt6))
# print(cnt1)
# print(cnt2)
# print(cnt3)
# print(cnt4)
if z == len(cnt1):
    a,b = -1,-1
    for c,x1,y1 in cnt1:
        if mini1 == c:
           a,b =  x1,y1
           break
    print(len(cnt1))
    if a == x :
       print(x,b)
    else:
       print(a,y)




elif z == len(cnt2):
    a,b = -1,-1
    for c,x1,y1 in cnt2:
        if mini2 == c:
            a,b =  x1,y1
            break
    print(len(cnt2))
    if a == x :
        print(x,b)
    else:
        print(a,y)




elif z == len(cnt3):
    a,b = -1,-1
    for c,x1,y1 in cnt3:
        if mini3 == c:
            a,b =  x1,y1
            break
    print(len(cnt3))
    if a == x :
        print(x,b)
    else:
        print(a,y)


elif z == len(cnt4):
    a,b = -1,-1
    for c,x1,y1 in cnt4:
        if mini4 == c:
            a,b =  x1,y1
            break
    print(len(cnt4))
    if a == x :
        print(x,b)
    else:
        print(a,y)

elif z == len(cnt5):
    a,b = -1,-1
    for c,x1,y1 in cnt5:
        if mini5 == c:
            a,b =  x1,y1
            break
    print(len(cnt5))

    print(a,y)

elif z == len(cnt6):
    a,b = -1,-1
    for c,x1,y1 in cnt6:
        if mini6 == c:
            a,b =  x1,y1
            break
    print(len(cnt6))

    print(a,y)






