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 collections import Counter as C,defaultdict as D,deque as Q
from operator import itemgetter as I
from itertools import product as P,permutations as PERMUT
from bisect import bisect_left as BL,bisect_right as BR,insort as INSORT
from heapq import heappush as HPUSH,heappop as HPOP
from math import floor as MF,ceil as MC, gcd as MG,factorial as F,sqrt as SQRT, inf as INFINITY,log as LOG
from sys import stdin, stdout
INPUT=stdin.readline
PRINT=stdout.write
L=list;M=map

def Player1():
	print("")

def Player2():
	print("")

def Yes():
	PRINT("Yes\n")

def No():
	PRINT("No\n")

def IsPrime(n):

	for i in range(2,MC(SQRT(n))+1):
		if n%i==0:
			return False
	return True

def Factors(x):

	ans=[]

	for i in range(1,MC(SQRT(x))+1):
		if x%i==0:
			ans.append(i)
			if x%(x//i)==0:
				ans.append(x//i)
	return ans
def CheckPath(source,destination,g):
	visited=[0]*101
	q=Q()
	q.append(source)
	visited[source]=1
	while q:
		node=q.popleft()
		if node==destination:
			return 1
		for v in g[node]:
			if not visited[v]:
				q.append(v)
				visited[v]=1
	return 0
def Sieve(n):
	prime=[1]*(n+1)
	p=2
	while p*p<=n:
		if prime[p]:
			for i in range(p*p,n+1,p):
				prime[i]=0
		p+=1
	primes=[]
	for p in range(2,n+1):
		if prime[p]:
			primes.append(p)
	return primes

def Prefix(a,n):
	p=[]
	for i in range(n):
		if i==0:
			p.append(a[0])
		else:
			p.append(p[-1]+a[i])
	return p
def Suffix(a,n):
	s=[0]*n
	for i in range(n-1,-1,-1):
		if i==n-1:
			s[i]=a[i]
		else:
			s[i]=s[i+1]+a[i]
	return s
def Spf(n):
	spf=[0 for i in range(n)]
	spf[1]=1
	for i in range(2,n):
		spf[i]=i
	for i in range(4,n,2):
		spf[i]=2
	for i in range(3,MC(SQRT(n))+1):
		if spf[i]==i:
			for j in range(i*i,n,i):
				if spf[j]==j:
					spf[j]=i
	return spf


def Main():

	n,x,y=M(int,INPUT().split( ))

	cright,cleft,rup,rdown=0,0,0,0

	for _ in range(n):
		i,j=M(int,INPUT().split( ))

		if i<x:
			rup+=1
		if i>x:
			rdown+=1
		if j>y:
			cright+=1
		if j<y:
			cleft+=1

	ans=[x,y];count=0

	if cright>=cleft:
		if rup>=rdown:
			if cright>=rup:
				ans[1]+=1
				count=cright
			else:
				ans[0]-=1
				count=rup
		else:
			if cright>=rdown:
				ans[1]+=1
				count=cright
			else:
				ans[0]+=1
				count=rdown
	else:
		if rup>=rdown:
			if cleft>=rup:
				ans[1]-=1
				count=cleft
			else:
				ans[0]-=1
				count=rup
		else:
			if cleft>=rdown:
				ans[1]-=1
				count=cleft
			else:
				ans[0]+=1
				count=rdown
	PRINT("%d\n"%(count))
	PRINT("%d %d"%(ans[0],ans[1]))


Main()

'mysql -u root -p'