The map of the capital of Berland can be viewed on the infinite coordinate plane. Each point with integer coordinates contains a building, and there are streets connecting every building to four neighbouring buildings. All streets are parallel to the coordinate axes.

The main school of the capital is located in $(s_x, s_y)$. There are $n$ students attending this school, the $i$-th of them lives in the house located in $(x_i, y_i)$. It is possible that some students live in the same house, but no student lives in $(s_x, s_y)$.

After classes end, each student walks from the school to his house along one of the shortest paths. So the distance the $i$-th student goes from the school to his house is $|s_x - x_i| + |s_y - y_i|$.

The Provision Department of Berland has decided to open a shawarma tent somewhere in the capital (at some point with integer coordinates). It is considered that the $i$-th student will buy a shawarma if at least one of the shortest paths from the school to the $i$-th student's house goes through the point where the shawarma tent is located. It is forbidden to place the shawarma tent at the point where the school is located, but the coordinates of the shawarma tent may coincide with the coordinates of the house of some student (or even multiple students).

You want to find the maximum possible number of students buying shawarma and the optimal location for the tent itself.


-----Input-----

The first line contains three integers $n$, $s_x$, $s_y$ ($1 \le n \le 200\,000$, $0 \le s_x, s_y \le 10^{9}$) — the number of students and the coordinates of the school, respectively.

Then $n$ lines follow. The $i$-th of them contains two integers $x_i$, $y_i$ ($0 \le x_i, y_i \le 10^{9}$) — the location of the house where the $i$-th student lives. Some locations of houses may coincide, but no student lives in the same location where the school is situated.


-----Output-----

The output should consist of two lines. The first of them should contain one integer $c$ — the maximum number of students that will buy shawarmas at the tent. 

The second line should contain two integers $p_x$ and $p_y$ — the coordinates where the tent should be located. If there are multiple answers, print any of them. Note that each of $p_x$ and $p_y$ should be not less than $0$ and not greater than $10^{9}$.


-----Examples-----
Input
4 3 2
1 3
4 2
5 1
4 1

Output
3
4 2

Input
3 100 100
0 0
0 0
100 200

Output
2
99 100

Input
7 10 12
5 6
20 23
15 4
16 5
4 54
12 1
4 15

Output
4
10 11



-----Note-----

In the first example, If we build the shawarma tent in $(4, 2)$, then the students living in $(4, 2)$, $(4, 1)$ and $(5, 1)$ will visit it.

In the second example, it is possible to build the shawarma tent in $(1, 1)$, then both students living in $(0, 0)$ will visit it.

Difficulty: EASY
Tags: Geometry

Complete search

Implementation

Greedy algorithms
Skill types: Complete search

Greedy algorithms

Starter code:

Solutions:
def main():
	(n, sx, sy) = map(int, input().split())
	(t, b, l, r) = (0, 0, 0, 0)
	for i in range(n):
		(x, y) = map(int, input().split())
		if x < sx:
			l += 1
		if x > sx:
			r += 1
		if y < sy:
			b += 1
		if y > sy:
			t += 1
	a = [(l, (sx - 1, sy)), (r, (sx + 1, sy)), (b, (sx, sy - 1)), (t, (sx, sy + 1))]
	ans = max(a)
	print(ans[0])
	print(*ans[1])
main()


import sys
input = sys.stdin.buffer.readline
(n, sx, sy) = map(int, input().split())
(l, r, u, d) = (0, 0, 0, 0)
for i in range(n):
	(p, q) = map(int, input().split())
	if p > sx:
		r += 1
	elif p < sx:
		l += 1
	if q > sy:
		u += 1
	else:
		d += 1
if l >= r and l >= u and (l >= d):
	print(l)
	print(sx - 1, sy)
elif r >= l and r >= u and (r >= d):
	print(r)
	print(sx + 1, sy)
elif u >= d and u >= l and (u >= r):
	print(u)
	print(sx, sy + 1)
else:
	print(d)
	print(sx, sy - 1)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	zz = 0
	for _ in range(1):
		(n, x, y) = ria()
		(l, r, u, d) = (0, 0, 0, 0)
		for i in range(n):
			(a, b) = ria()
			if a < x:
				l += 1
			if a > x:
				r += 1
			if b > y:
				u += 1
			if b < y:
				d += 1
		k = [l, r, u, d]
		z = max(k)
		for i in range(4):
			if k[i] == z:
				if i == 0:
					wi(l)
					print(x - 1, y)
				if i == 1:
					wi(r)
					print(x + 1, y)
				if i == 2:
					wi(u)
					print(x, y + 1)
				if i == 3:
					wi(d)
					print(x, y - 1)
				break
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


def main():
	(n, sx, sy) = map(int, input().split())
	S = [tuple(map(int, input().split())) for _ in range(n)]
	ans = [0] * 4
	for (x, y) in S:
		if x <= sx - 1:
			ans[0] += 1
		elif x >= sx + 1:
			ans[1] += 1
		if y <= sy - 1:
			ans[2] += 1
		elif y >= sy + 1:
			ans[3] += 1
	if sx == 0:
		ans[0] = -1
	elif sx == 10 ** 9:
		ans[1] = -1
	if sy == 0:
		ans[2] = -1
	elif sy == 10 ** 9:
		ans[3] = -1
	m = max(ans)
	print(m)
	point = [(sx - 1, sy), (sx + 1, sy), (sx, sy - 1), (sx, sy + 1)]
	for i in range(4):
		if ans[i] == m:
			print(point[i][0], point[i][1])
			break
main()


(n, sx, sy) = map(int, input().split())
lst = []
for i in range(n):
	lst.append(list(map(int, input().split())))
quad1 = 0
quad2 = 0
quad3 = 0
quad4 = 0
for i in range(n):
	if lst[i][0] > sx:
		quad1 += 1
	if lst[i][1] > sy:
		quad2 += 1
	if lst[i][0] < sx:
		quad3 += 1
	if lst[i][1] < sy:
		quad4 += 1
count = [quad1, quad2, quad3, quad4]
temp = max(count)
print(temp)
ind = count.index(temp)
if ind == 0:
	print(sx + 1, sy)
elif ind == 1:
	print(sx, sy + 1)
elif ind == 2:
	print(sx - 1, sy)
else:
	print(sx, sy - 1)


(n, sx, sy) = map(int, input().split())
lx = sx - 1
ly = sy
rx = sx + 1
ry = sy
ux = sx
uy = sy + 1
dx = sx
dy = sy - 1
l = list()
l.append([0, dx, dy])
l.append([0, rx, ry])
l.append([0, ux, uy])
l.append([0, lx, ly])
for i in range(n):
	(x, y) = map(int, input().split())
	if x == sx and y < sy:
		l[0][0] += 1
	elif x == sx and y > sy:
		l[2][0] += 1
	elif y == sy and x < sx:
		l[3][0] += 1
	elif y == sy and x > sx:
		l[1][0] += 1
	elif x < sx and y < sy:
		l[0][0] += 1
		l[3][0] += 1
	elif x > sx and y < sy:
		l[0][0] += 1
		l[1][0] += 1
	elif x > sx and y > sy:
		l[1][0] += 1
		l[2][0] += 1
	elif x < sx and y > sy:
		l[2][0] += 1
		l[3][0] += 1
maxi = -1
ind = -1
for i in range(4):
	if l[i][0] > maxi:
		maxi = l[i][0]
		ind = i
print(l[ind][0])
print(l[ind][1], l[ind][2])


from sys import stdin, stdout
(n, sx, sy) = map(int, stdin.readline().split())
counts = {(1, 0): 0, (-1, 0): 0, (0, 1): 0, (0, -1): 0}
for _ in range(n):
	(x, y) = map(int, stdin.readline().split())
	if x > sx:
		counts[1, 0] += 1
	elif x < sx:
		counts[-1, 0] += 1
	if y > sy:
		counts[0, 1] += 1
	elif y < sy:
		counts[0, -1] += 1
(maxcount, ans) = (0, None)
for (d, v) in counts.items():
	if v > maxcount:
		(maxcount, ans) = (v, d)
stdout.write('{}\n{} {}'.format(maxcount, sx + ans[0], sy + ans[1]))


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
(n, sx, sy) = invr()
l = []
for i in range(n):
	(a, b) = invr()
	l.append([a, b])
(left, right, up, down) = (0, 0, 0, 0)
for each in l:
	(a, b) = each
	if a > sx:
		right += 1
	if a < sx:
		left += 1
	if b > sy:
		up += 1
	if b < sy:
		down += 1
s = max(left, right, up, down)
print(s)
if s == right:
	print(sx + 1, sy)
elif s == left:
	print(sx - 1, sy)
elif s == up:
	print(sx, sy + 1)
elif s == down:
	print(sx, sy - 1)


import sys
(n, sx, sy) = map(int, input().split())
count = [0] * 4
delta = [[-1, 0], [1, 0], [0, -1], [0, 1]]
for (x, y) in (map(int, l.split()) for l in sys.stdin):
	if x < sx:
		count[0] += 1
	elif sx < x:
		count[1] += 1
	if y < sy:
		count[2] += 1
	elif sy < y:
		count[3] += 1
if sx == 0:
	count[0] = 0
if sx == 10 ** 9:
	count[1] = 0
if sy == 0:
	count[2] = 0
if sy == 10 ** 9:
	count[3] = 0
max_c = max(count)
for i in range(4):
	if max_c == count[i]:
		print(max_c)
		print(sx + delta[i][0], sy + delta[i][1])
		break


import sys

def LI():
	return map(int, sys.stdin.readline().split())
[N, sx, sy] = LI()
pts = [(0, 1), (1, 0), (0, -1), (-1, 0)]
v = [0] * 4
for _ in range(N):
	[x, y] = LI()
	if x > sx:
		v[1] += 1
	if x < sx:
		v[3] += 1
	if y > sy:
		v[0] += 1
	if y < sy:
		v[2] += 1
c = [(v, x, y) for (v, x, y) in [(v[i], sx + pts[i][0], sy + pts[i][1]) for i in range(4)] if 0 <= x <= 10 ** 9 and 0 <= y <= 10 ** 9]
(v, x, y) = max(c, key=lambda t: t[0])
print(v)
print(x, y)


import sys
input = sys.stdin.readline
from collections import *
(n, sx, sy) = map(int, input().split())
xy = [tuple(map(int, input().split())) for _ in range(n)]
ans = 0
(px, py) = (-1, -1)
cnt = 0
for (x, y) in xy:
	if y <= sy - 1:
		cnt += 1
if cnt > ans:
	ans = cnt
	(px, py) = (sx, sy - 1)
cnt = 0
for (x, y) in xy:
	if y >= sy + 1:
		cnt += 1
if cnt > ans:
	ans = cnt
	(px, py) = (sx, sy + 1)
cnt = 0
for (x, y) in xy:
	if x >= sx + 1:
		cnt += 1
if cnt > ans:
	ans = cnt
	(px, py) = (sx + 1, sy)
cnt = 0
for (x, y) in xy:
	if x <= sx - 1:
		cnt += 1
if cnt > ans:
	ans = cnt
	(px, py) = (sx - 1, sy)
print(ans)
print(px, py)


(n, x, y) = map(int, input().split())
pl = 0
pr = 0
pt = 0
pb = 0
arr = []
for i in range(n):
	(a, b) = map(int, input().split())
	arr.append([a, b])
	if a > x:
		pr += 1
	if b > y:
		pt += 1
	if a < x:
		pl += 1
	if b < y:
		pb += 1
z = max(pr, pl, pt, pb)
print(z)
if z == pr:
	print(x + 1, y)
elif z == pt:
	print(x, y + 1)
elif z == pl:
	print(x - 1, y)
elif z == pb:
	print(x, y - 1)


import sys

def main():
	(n, sx, sy) = get_ints()
	d = [0] * 4
	arr = []
	for i in range(n):
		(x, y) = get_ints()
		x -= sx
		y -= sy
		arr.append((x, y))
		if y >= 1:
			d[0] += 1
		if x <= -1:
			d[1] += 1
		if y <= -1:
			d[2] += 1
		if x >= 1:
			d[3] += 1
	ans = max(d)
	print(ans)
	if d[0] == ans:
		print(sx, sy + 1)
	elif d[1] == ans:
		print(sx - 1, sy)
	elif d[2] == ans:
		print(sx, sy - 1)
	else:
		print(sx + 1, sy)
get_array = lambda : list(map(int, sys.stdin.readline().split()))
get_ints = lambda : map(int, sys.stdin.readline().split())
input = lambda : sys.stdin.readline().strip()
main()


m = 1000000000
(n, sx, sy) = map(int, input().split())
c = [tuple((int(_) for _ in input().split())) for i in range(n)]
(bst, ans) = (0, None)
if sx > 0:
	v = sum((1 for p in c if p[0] < sx))
	if v > bst:
		(bst, ans) = (v, (sx - 1, sy))
if sy > 0:
	v = sum((1 for p in c if p[1] < sy))
	if v > bst:
		(bst, ans) = (v, (sx, sy - 1))
if sx < m:
	v = sum((1 for p in c if p[0] > sx))
	if v > bst:
		(bst, ans) = (v, (sx + 1, sy))
if sy < m:
	v = sum((1 for p in c if p[1] > sy))
	if v > bst:
		(bst, ans) = (v, (sx, sy + 1))
print(bst)
print(*ans)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
(n, sx, sy) = mp()
ml = [tuple(mp()) for i in range(n)]
arr = [(sx - 1, sy), (sx + 1, sy), (sx, sy - 1), (sx, sy + 1)]
m = l1d(4)
for i in ml:
	if i[0] < sx:
		m[0] += 1
	if i[0] > sx:
		m[1] += 1
	if i[1] < sy:
		m[2] += 1
	if i[1] > sy:
		m[3] += 1
ind = m.index(max(m))
print(max(m))
print(*arr[ind])


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
info = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
	info[i][0] -= sx
	info[i][1] -= sy
cnt_1 = 0
cnt_2 = 0
cnt_3 = 0
cnt_4 = 0
for i in range(n):
	if info[i][0] >= 1:
		cnt_1 += 1
	if info[i][1] <= -1:
		cnt_2 += 1
	if info[i][0] <= -1:
		cnt_3 += 1
	if info[i][1] >= 1:
		cnt_4 += 1
max_ = max(cnt_1, cnt_2, cnt_3, cnt_4)
if max_ == cnt_1:
	print(cnt_1)
	print(sx + 1, sy)
	exit()
if max_ == cnt_2:
	print(cnt_2)
	print(sx, sy - 1)
	exit()
if max_ == cnt_3:
	print(cnt_3)
	print(sx - 1, sy)
	exit()
if max_ == cnt_4:
	print(cnt_4)
	print(sx, sy + 1)
	exit()


(n, sx, sy) = [int(i) for i in input().split()]
lis = []
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	lis.append([x, y])
down_left_right = 0
up_left_right = 0
right_top_down = 0
left_top_down = 0
for i in range(n):
	(a, b) = lis[i]
	if a > sx:
		right_top_down += 1
		if b > sy:
			up_left_right += 1
		elif b < sy:
			down_left_right += 1
	elif a < sx:
		left_top_down += 1
		if b > sy:
			up_left_right += 1
		elif b < sy:
			down_left_right += 1
	elif a == sx:
		if b > sy:
			up_left_right += 1
		elif b < sy:
			down_left_right += 1
m1 = down_left_right
m2 = up_left_right
m3 = left_top_down
m4 = right_top_down
ma = max(m1, m2, m3, m4)
if ma == m1:
	print(ma)
	print(sx, sy - 1)
elif ma == m2:
	print(ma)
	print(sx, sy + 1)
elif ma == m3:
	print(ma)
	print(sx - 1, sy)
elif ma == m4:
	print(ma)
	print(sx + 1, sy)


(l, r, u, d) = (0, 0, 0, 0)
(n, sx, sy) = map(int, input().split())
for i in range(n):
	(x, y) = map(int, input().split())
	if x < sx:
		l += 1
	if sx < x:
		r += 1
	if y < sy:
		u += 1
	if sy < y:
		d += 1
ans = max(u, l, r, d)
print(ans)
if ans == u:
	print(sx, sy - 1)
elif ans == r:
	print(sx + 1, sy)
elif ans == d:
	print(sx, sy + 1)
else:
	print(sx - 1, sy)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, sx, sy) = map(int, input().split())
u = 0
d = 0
l = 0
r = 0
for s in range(n):
	(x, y) = map(int, input().split())
	valx = sx - x
	valy = sy - y
	if valx != 0 and valy != 0:
		if valx > 0:
			if valy > 0:
				d += 1
				l += 1
			else:
				u += 1
				l += 1
		elif valy > 0:
			d += 1
			r += 1
		else:
			u += 1
			r += 1
	elif valx == 0:
		if valy > 0:
			d += 1
		else:
			u += 1
	elif valx > 0:
		l += 1
	else:
		r += 1
listy = [u, d, r, l]
listy1 = [(0, 1), (0, -1), (1, 0), (-1, 0)]
key = 0
val = 0
for s in range(len(listy)):
	if listy[s] > val:
		val = listy[s]
		key = s
(sx, sy) = (sx + listy1[key][0], sy + listy1[key][1])
print(val)
print(str(sx) + ' ' + str(sy))


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
(n, sx, sy) = map(int, input().split())
s = [0, 0, 0, 0]
for i in range(n):
	(x, y) = map(int, input().split())
	if x < sx:
		s[0] += 1
	elif sx < x:
		s[1] += 1
	if y < sy:
		s[2] += 1
	elif sy < y:
		s[3] += 1
s = [(s[i], i) for i in range(4)]
s.sort(key=lambda x: -x[0])
dxdy = [(-1, 0), (1, 0), (0, -1), (0, 1)]
for i in range(4):
	(ans, j) = s[i]
	(px, py) = (sx + dxdy[j][0], sy + dxdy[j][1])
	if 0 <= px <= 10 ** 9 and 0 <= py <= 10 ** 9:
		print(ans)
		print(px, py)
		exit()


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
string = ''
(a, *x) = map(int, input().split())
up = 0
down = 0
left = 0
right = 0
for i in range(a):
	(m, n) = map(int, input().split())
	if m < x[0] and n != x[1]:
		if n > x[1]:
			left += 1
			up += 1
		elif n < x[1]:
			down += 1
			left += 1
	elif m > x[0] and n != x[1]:
		if n < x[1]:
			right += 1
			down += 1
		elif n > x[1]:
			up += 1
			right += 1
	elif m == x[0] or n == x[1]:
		if m == x[0] and n == x[1]:
			pass
		elif m == x[0] and n != x[1]:
			if n < x[1]:
				down += 1
			else:
				up += 1
		elif m != x[0] and n == x[1]:
			if m < x[0]:
				left += 1
			else:
				right += 1
ans = [up, down, left, right]
aaa = max(ans)
string += str(aaa) + '\n'
if ans[0] == aaa:
	string += str(x[0]) + ' ' + str(x[1] + 1) + '\n'
elif ans[1] == aaa:
	string += str(x[0]) + ' ' + str(x[1] - 1) + '\n'
elif ans[2] == aaa:
	string += str(x[0] - 1) + ' ' + str(x[1]) + '\n'
elif ans[3] == aaa:
	string += str(x[0] + 1) + ' ' + str(x[1]) + '\n'
print(string)


(n, sx, sy) = map(int, input().split())
b = [0] * 4
for i in range(n):
	(x, y) = map(int, input().split())
	if sy == y:
		if sx < x:
			b[0] += 1
		else:
			b[2] += 1
	elif sx == x:
		if sy < y:
			b[1] += 1
		else:
			b[3] += 1
	elif sx < x:
		b[0] += 1
		if sy < y:
			b[1] += 1
		else:
			b[3] += 1
	elif sx > x:
		b[2] += 1
		if sy < y:
			b[1] += 1
		else:
			b[3] += 1
a = max(b)
print(a)
i = b.index(a)
if i == 0:
	print(sx + 1, sy)
elif i == 1:
	print(sx, sy + 1)
elif i == 2:
	print(sx - 1, sy)
else:
	print(sx, sy - 1)


from sys import stdin, stdout, setrecursionlimit
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm, accumulate
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
setrecursionlimit(10 ** 9)
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return input()

def num():
	return int(input())

def L():
	return list(sp())

def LF():
	return list(spf())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def spf():
	return map(int, input.readline().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def pmat(A):
	for ele in A:
		print(*ele, end='\n')

def pmat2(A):
	for ele in A:
		for j in ele:
			print(j, end='')
		print()

def iseven(n):
	return n % 2 == 0

def seive(r):
	prime = [1 for i in range(r + 1)]
	prime[0] = 0
	prime[1] = 0
	for i in range(r + 1):
		if prime[i]:
			for j in range(2 * i, r + 1, i):
				prime[j] = 0
	return prime
(n, x, y) = sp()
(l, r, u, d) = (0, 0, 0, 0)
for _ in range(n):
	(x1, y1) = sp()
	if x1 < x:
		l += 1
	if x1 > x:
		r += 1
	if y1 > y:
		u += 1
	if y1 < y:
		d += 1
mx = max([l, r, u, d])
print(mx)
if mx == l:
	print(x - 1, y)
elif mx == r:
	print(x + 1, y)
elif mx == u:
	print(x, y + 1)
else:
	print(x, y - 1)
endtime = time.time()


def main():
	(n, X, Y) = map(int, input().split())
	(cntx, cntnegx, cnty, cntnegy) = (0, 0, 0, 0)
	for _ in range(n):
		(x, y) = map(int, input().split())
		if x < X:
			cntnegx += 1
		elif x > X:
			cntx += 1
		if y < Y:
			cntnegy += 1
		elif y > Y:
			cnty += 1
	mx = max(cnty, cntx, cntnegy, cntnegx)
	print(mx)
	if mx == cntx:
		print(X + 1, Y)
	elif mx == cnty:
		print(X, Y + 1)
	elif mx == cntnegx:
		print(X - 1, Y)
	else:
		print(X, Y - 1)
	return
main()


import os
import sys
from io import BytesIO, IOBase

def solve(n, sx, sy, points):
	ps = [(sx + 1, sy), (sx - 1, sy), (sx, sy + 1), (sx, sy - 1)]
	aps = [0, 0, 0, 0]
	for (x, y) in points:
		for (i, p) in enumerate(ps):
			if p[0] > sx and x >= p[0]:
				aps[i] += 1
			if p[0] < sx and x <= p[0]:
				aps[i] += 1
			if p[1] > sy and y >= p[1]:
				aps[i] += 1
			if p[1] < sy and y <= p[1]:
				aps[i] += 1
	return (max(aps), ps[aps.index(max(aps))])

def main():
	[n, sx, sy] = list(map(int, input().strip().split()))
	points = []
	points = [tuple(map(int, input().strip().split())) for _ in range(n)]
	(a, (ax, ay)) = solve(n, sx, sy, points)
	print(a)
	print(ax, ay)
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


from sys import stdin
input = stdin.readline
R = lambda : map(int, input().split())
(n, s1, s2) = R()
u = d = r = l = 0
for _ in range(n):
	(x, y) = R()
	if x > s1:
		r += 1
	elif x < s1:
		l += 1
	if y > s2:
		u += 1
	elif y < s2:
		d += 1
m = max([r, l, d, u])
print(m)
if m == r:
	print(s1 + 1, s2)
elif m == l:
	print(s1 - 1, s2)
elif m == u:
	print(s1, s2 + 1)
elif m == d:
	print(s1, s2 - 1)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def main():
	(n, sx, sy) = map(int, input().split())
	xy = []
	for i in range(n):
		xy.append(list(map(int, input().split())))
	up = 0
	down = 0
	left = 0
	right = 0
	for i in xy:
		if i[0] > sx:
			right += 1
		if i[0] < sx:
			left += 1
		if i[1] < sy:
			down += 1
		if i[1] > sy:
			up += 1
	k = max(up, max(down, max(left, right)))
	print(k)
	if k == up:
		print(sx, sy + 1)
	elif k == down:
		print(sx, sy - 1)
	elif k == left:
		print(sx - 1, sy)
	else:
		print(sx + 1, sy)
	return
main()


(n, x, y) = map(int, input().split())
a1 = a2 = b1 = b2 = 0
for i in range(n):
	(x1, y1) = map(int, input().split())
	if x1 < x:
		a1 += 1
	elif x1 > x:
		a2 += 1
	if y1 < y:
		b1 += 1
	elif y1 > y:
		b2 += 1
m = max(a1, a2, b1, b2)
if m == a1:
	print(a1)
	print(x - 1, y)
elif m == a2:
	print(a2)
	print(x + 1, y)
elif m == b1:
	print(b1)
	print(x, y - 1)
else:
	print(b2)
	print(x, y + 1)


(n, sx, sy) = [int(i) for i in input().split()]
(xs, xn, xv, xz) = (0, 0, 0, 0)
for i in range(n):
	(ux, uy) = [int(i) for i in input().split()]
	if uy - sy > 0:
		xn += 1
	if uy - sy < 0:
		xs += 1
	if ux - sx > 0:
		xv += 1
	if ux - sx < 0:
		xz += 1
for kl in range(1):
	if xn >= max(xn, xs, xv, xz):
		print(xn)
		print(sx, sy + 1)
		break
	if xs >= max(xn, xs, xv, xz):
		print(xs)
		print(sx, sy - 1)
		break
	if xv >= max(xn, xs, xv, xz):
		print(xv)
		print(sx + 1, sy)
		break
	if xz >= max(xn, xs, xv, xz):
		print(xz)
		print(sx - 1, sy)
		break


(n, h, k) = map(int, input().split())
x = []
y = []
for i in range(n):
	(a, b) = map(int, input().split())
	x.append(a - h)
	y.append(b - k)
d = {1: 0, 2: 0, 3: 0, 4: 0}
for i in range(n):
	if x[i] == 0:
		if y[i] < 0:
			d[4] += 1
		else:
			d[2] += 1
	elif y[i] == 0:
		if x[i] < 0:
			d[3] += 1
		else:
			d[1] += 1
	elif x[i] > 0 and y[i] > 0:
		d[1] += 1
		d[2] += 1
	elif x[i] > 0 and y[i] < 0:
		d[1] += 1
		d[4] += 1
	elif x[i] < 0 and y[i] < 0:
		d[4] += 1
		d[3] += 1
	else:
		d[2] += 1
		d[3] += 1
m = max(d[1], d[3], d[2], d[4])
print(m)
if m == d[1]:
	print(h + 1, k)
elif m == d[2]:
	print(h, k + 1)
elif m == d[3]:
	print(h - 1, k)
else:
	print(h, k - 1)


a = input('').split(' ')
n = int(a[0])
sx = int(a[1])
sy = int(a[2])
xs = []
ys = []
yp = 0
yn = 0
xp = 0
xn = 0
for i in range(n):
	a = input('').split(' ')
	xs.append(int(a[0]))
	ys.append(int(a[1]))
	if ys[i] > sy:
		yp += 1
	if ys[i] < sy:
		yn += 1
	if xs[i] > sx:
		xp += 1
	if xs[i] < sx:
		xn += 1
m = max(yp, yn, xn, xp)
print(m)
if m == yp:
	print(str(sx) + ' ' + str(sy + 1))
elif m == yn:
	print(str(sx) + ' ' + str(sy - 1))
elif m == xp:
	print(str(sx + 1) + ' ' + str(sy))
elif m == xn:
	print(str(sx - 1) + ' ' + str(sy))


(n, tx, ty) = map(int, input().split())
ans = [0] * 4
(r, l, u, d) = range(4)
for _ in [0] * n:
	(x, y) = map(int, input().split())
	if x > tx:
		ans[r] += 1
		if y > ty:
			ans[u] += 1
		elif y < ty:
			ans[d] += 1
	elif x == tx:
		if y > ty:
			ans[u] += 1
		else:
			ans[d] += 1
	else:
		ans[l] += 1
		if y > ty:
			ans[u] += 1
		elif y < ty:
			ans[d] += 1
num = 0
pos = -1
for i in range(4):
	if ans[i] > num:
		num = ans[i]
		pos = i
print(num)
print([str(tx + 1) + ' ' + str(ty), str(tx - 1) + ' ' + str(ty), str(tx) + ' ' + str(ty + 1), str(tx) + ' ' + str(ty - 1)][pos])


(n, sx, sy) = map(int, input().split())
(t1, t2) = (sx - 1, sy)
(t3, t4) = (sx + 1, sy)
(t5, t6) = (sx, sy + 1)
(t7, t8) = (sx, sy - 1)
(c1, c2, c3, c4) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	temp = abs(sx - x) + abs(sy - y)
	if temp >= abs(t1 - x) + abs(t2 - y):
		c1 += 1
	if temp >= abs(t3 - x) + abs(t4 - y):
		c2 += 1
	if temp >= abs(t5 - x) + abs(t6 - y):
		c3 += 1
	if temp >= abs(t7 - x) + abs(t8 - y):
		c4 += 1
count = max(c1, c2, c3, c4)
if count == c1:
	print(c1)
	print(t1, t2)
elif count == c2:
	print(c2)
	print(t3, t4)
elif count == c3:
	print(c3)
	print(t5, t6)
elif count == c4:
	print(c4)
	print(t7, t8)


from sys import stdin, gettrace

def input():
	return stdin.buffer.readline()
(t, x, y) = map(int, input().split())
quarters = [0] * 4
borders = [0] * 4
for i in range(t):
	(tx, ty) = map(int, input().split())
	if tx < x and ty < y:
		quarters[0] += 1
	elif tx > x and ty < y:
		quarters[1] += 1
	elif tx > x and ty > y:
		quarters[2] += 1
	elif tx < x and ty > y:
		quarters[3] += 1
	elif tx == x and ty < y:
		borders[0] += 1
	elif tx > x and ty == y:
		borders[1] += 1
	elif tx == x and ty > y:
		borders[2] += 1
	elif tx < x and ty == y:
		borders[3] += 1
max_i = 0
max = -float('inf')
quarters.append(quarters[0])
for i in range(4):
	val_i = quarters[i] + quarters[i + 1] + borders[i]
	if val_i > max:
		max = val_i
		max_i = i
positions = [(x, y - 1), (x + 1, y), (x, y + 1), (x - 1, y)]
print(max)
print(*positions[max_i])


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
living = []
for i in range(n):
	living.append(list(map(int, input().split())))
east = 0
for i in range(n):
	if living[i][0] > sx:
		east += 1
west = 0
for i in range(n):
	if living[i][0] < sx:
		west += 1
north = 0
for i in range(n):
	if living[i][1] > sy:
		north += 1
south = 0
for i in range(n):
	if living[i][1] < sy:
		south += 1
maxi = max(east, west, north, south)
if maxi == east:
	print(east)
	print(sx + 1, sy)
elif maxi == west:
	print(west)
	print(sx - 1, sy)
elif maxi == north:
	print(north)
	print(sx, sy + 1)
else:
	print(south)
	print(sx, sy - 1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
(n, x, y) = Ri()
(l, r, u, d) = (0, 0, 0, 0)
for i in range(n):
	(tx, ty) = Ri()
	if x - tx > 0:
		l += 1
	elif x - tx < 0:
		r += 1
	if y - ty > 0:
		d += 1
	elif y - ty < 0:
		u += 1
maxx = max(l, r, u, d)
if maxx == l:
	print(maxx)
	print(x - 1, y)
elif maxx == r:
	print(maxx)
	print(x + 1, y)
elif maxx == u:
	print(maxx)
	print(x, y + 1)
elif maxx == d:
	print(maxx)
	print(x, y - 1)


(n, school_x, school_y) = map(int, input().split())
(left, right, up, down) = (0, 0, 0, 0)
for _ in range(n):
	(tx, ty) = map(int, input().split())
	if tx < school_x:
		left += 1
	elif tx > school_x:
		right += 1
	if ty < school_y:
		down += 1
	elif ty > school_y:
		up += 1
maxx = max(left, right, up, down)
if maxx == left:
	school_x -= 1
elif maxx == right:
	school_x += 1
elif maxx == up:
	school_y += 1
else:
	school_y -= 1
print(maxx)
print(school_x, school_y)


(n, s1, s2) = map(int, input().split())
li = [0] * 4
l = [0] * 4
for i in range(n):
	(a, b) = map(int, input().split())
	if a > s1 and b > s2:
		li[0] += 1
	elif a > s1 and b == s2:
		l[0] += 1
	elif a > s1 and b < s2:
		li[1] += 1
	elif a == s1 and b < s2:
		l[1] += 1
	elif a < s1 and b > s2:
		li[3] += 1
	elif a < s1 and b == s2:
		l[2] += 1
	elif a < s1 and b < s2:
		li[2] += 1
	elif a == s1 and b > s2:
		l[3] += 1
ans = [0] * 4
ans[0] = li[1] + li[0] + l[0]
ans[1] = li[1] + li[2] + l[1]
ans[2] = li[2] + li[3] + l[2]
ans[3] = li[3] + li[0] + l[3]
print(max(ans))
if max(ans) == ans[0]:
	print(s1 + 1, s2)
elif max(ans) == ans[1]:
	print(s1, s2 - 1)
elif max(ans) == ans[2]:
	print(s1 - 1, s2)
else:
	print(s1, s2 + 1)


(n, sx, sy) = map(int, input().split())
k = 0
k1 = 0
k2 = 0
k3 = 0
for _ in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		k3 += 1
	if x < sx:
		k1 += 1
	if y > sy:
		k += 1
	if y < sy:
		k2 += 1
x = max(k, k1, k2, k3)
print(x)
if x == k:
	print(sx, sy + 1)
elif x == k1:
	print(sx - 1, sy)
elif x == k2:
	print(sx, sy - 1)
else:
	print(sx + 1, sy)


from sys import stdin, stdout
input = stdin.readline

def inputnums():
	return map(int, input().split())
(n, sx, sy) = inputnums()
N = 0
S = 0
E = 0
W = 0
for i in range(n):
	l = [int(x) for x in input().split(' ')]
	if l[1] > sy:
		N += 1
	elif l[1] < sy:
		S += 1
	if l[0] > sx:
		E += 1
	elif l[0] < sx:
		W += 1
mx = max([N, S, E, W])
print(mx)
if N == mx:
	print(sx, sy + 1)
elif S == mx:
	print(sx, sy - 1)
elif E == mx:
	print(sx + 1, sy)
else:
	print(sx - 1, sy)


(n, sx, sy) = map(int, input().split(' '))
ans = [0, 0, 0, 0]
for i in range(n):
	(a, b) = map(int, input().split(' '))
	if a < sx:
		ans[0] += 1
	if sx < a:
		ans[1] += 1
	if sy < b:
		ans[2] += 1
	if b < sy:
		ans[3] += 1
if ans[0] == max(ans):
	print(str(ans[0]))
	print(str(sx - 1) + ' ' + str(sy))
elif ans[1] == max(ans):
	print(str(ans[1]))
	print(str(sx + 1) + ' ' + str(sy))
elif ans[2] == max(ans):
	print(str(ans[2]))
	print(str(sx) + ' ' + str(sy + 1))
elif ans[3] == max(ans):
	print(str(ans[3]))
	print(str(sx) + ' ' + str(sy - 1))


from sys import stdin
input = stdin.readline
(n, sx, sy) = map(int, input().split())
neighbors = [(sx + 1, sy), (sx, sy + 1), (sx - 1, sy), (sx, sy - 1)]
scores = [0, 0, 0, 0]
for i in range(n):
	(x, y) = map(int, input().split())
	for (i, (px, py)) in enumerate(neighbors):
		if min(sx, x) <= px <= max(sx, x) and min(sy, y) <= py <= max(sy, y):
			scores[i] += 1
maxVal = 0
for (i, score) in enumerate(scores):
	if score > maxVal:
		maxVal = score
		ans = neighbors[i]
print(maxVal)
print(ans[0], ans[1])


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict

def getlist():
	return list(map(int, input().split()))

def main():
	(N, sx, sy) = getlist()
	a = 0
	b = 0
	c = 0
	d = 0
	for i in range(N):
		(x, y) = getlist()
		if y >= sy + 1:
			a += 1
		if x <= sx - 1:
			b += 1
		if x >= sx + 1:
			c += 1
		if y <= sy - 1:
			d += 1
	D = max(a, b, c, d)
	if a == D:
		print(a)
		print(sx, sy + 1)
	elif b == D:
		print(b)
		print(sx - 1, sy)
	elif c == D:
		print(c)
		print(sx + 1, sy)
	else:
		print(d)
		print(sx, sy - 1)
main()


from sys import stdin
input = stdin.readline
(n, sx, sy) = map(int, input().split())
l = 0
r = 0
u = 0
d = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if a > sx:
		r += 1
	if a < sx:
		l += 1
	if b > sy:
		u += 1
	if b < sy:
		d += 1
dd = max(u, d, r, l)
print(dd)
if u == dd:
	print(sx, sy + 1)
elif d == dd:
	print(sx, sy - 1)
elif r == dd:
	print(sx + 1, sy)
elif l == dd:
	print(sx - 1, sy)


import sys, bisect
(n, sx, sy) = map(int, sys.stdin.readline().split())
arr = []
for _ in range(n):
	(a, b) = map(int, sys.stdin.readline().split())
	arr.append((a, b))
temp = [[sx, sy + 1, 0], [sx, sy - 1, 0], [sx + 1, sy, 0], [sx - 1, sy, 0]]
for i in temp:
	for j in range(n):
		if i[1] > sy:
			if arr[j][1] >= i[1]:
				i[2] += 1
		elif i[1] < sy:
			if arr[j][1] <= i[1]:
				i[2] += 1
		elif i[0] > sx:
			if arr[j][0] >= i[0]:
				i[2] += 1
		elif i[0] < sx:
			if arr[j][0] <= i[0]:
				i[2] += 1
temp.sort(key=lambda x: -x[2])
for i in temp:
	if 0 <= i[0] <= pow(10, 9) and 0 <= i[1] <= pow(10, 9):
		print(i[2])
		print(i[0], i[1])
		break


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(n, sx, sy) = list(map(int, input().split()))
d = {}
d1 = {}
if sx < 10 ** 9:
	p1 = [sx + 1, sy]
	d['p1'] = p1
	d1['p1'] = 0
if sy < 10 ** 9:
	p2 = [sx, sy + 1]
	d['p2'] = p2
	d1['p2'] = 0
if sx > 0:
	p3 = [sx - 1, sy]
	d['p3'] = p3
	d1['p3'] = 0
if sy > 0:
	p4 = [sx, sy - 1]
	d['p4'] = p4
	d1['p4'] = 0
for i in range(n):
	(x, y) = list(map(int, input().split()))
	d3 = {}
	mv = 0
	s = ''
	for i in d:
		pd = abs(x - d[i][0]) + abs(y - d[i][1])
		d3[i] = pd
	mv = min(d3.values())
	for i in d3:
		if d3[i] == mv:
			d1[i] += 1
mv = max(d1.values())
print(mv)
for i in d1:
	if d1[i] == mv:
		print(*d[i])
		break


import sys
input = sys.stdin.buffer.readline
(n, sx, sy) = [int(x) for x in input().split()]
up = 0
down = 0
left = 0
right = 0
for _ in range(n):
	(x, y) = [int(x) for x in input().split()]
	if sx < x:
		right += 1
	if x < sx:
		left += 1
	if sy < y:
		up += 1
	if y < sy:
		down += 1
c = max(up, down, left, right)
print(c)
if c == up:
	print('{} {}'.format(sx, sy + 1))
elif c == down:
	print('{} {}'.format(sx, sy - 1))
elif c == left:
	print('{} {}'.format(sx - 1, sy))
elif c == right:
	print('{} {}'.format(sx + 1, sy))


from collections import defaultdict
(a, sx, sy) = map(int, input().split())
s = defaultdict(int)
for _ in range(a):
	(px, py) = map(int, input().split())
	if px > sx:
		s['right'] += 1
	if py > sy:
		s['up'] += 1
	if px < sx:
		s['left'] += 1
	if py < sy:
		s['down'] += 1
max_stu = 0
pos = 0
for i in s.items():
	if max_stu < i[1]:
		max_stu = i[1]
		pos = i[0]
print(max_stu)
if pos == 'right':
	print(sx + 1, sy)
if pos == 'left':
	print(sx - 1, sy)
if pos == 'up':
	print(sx, sy + 1)
if pos == 'down':
	print(sx, sy - 1)


import time

def st(it):
	return [str(ita) for ita in it]
LOCAL = False
start_time = None
if LOCAL:
	start_time = time.time()
(n, sx, sy) = list(map(lambda x: int(x), input().split(' ')))
a = 0
b = 0
c = 0
d = 0
for i in range(n):
	(x, y) = list(map(lambda x: int(x), input().split(' ')))
	if x > sx:
		a += 1
	if x < sx:
		b += 1
	if y > sy:
		c += 1
	if y < sy:
		d += 1
q = max(a, b, c, d)
if a == q:
	sx += 1
elif b == q:
	sx -= 1
elif c == q:
	sy += 1
elif d == q:
	sy -= 1
print(q)
print(sx, sy)
if LOCAL:
	print('--- %s seconds ---' % (time.time() - start_time))


import sys
import os
from io import BytesIO, IOBase

def cel(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
for _ in range(1):
	(n, sx, sy) = mi()
	(r, l, u, d) = (0, 0, 0, 0)
	for i in range(n):
		(x, y) = mi()
		if x > sx:
			r += 1
		elif x < sx:
			l += 1
		if y > sy:
			u += 1
		elif y < sy:
			d += 1
	if r == max(l, r, u, d):
		print(r)
		print(sx + 1, sy)
	elif l == max(l, r, u, d):
		print(l)
		print(sx - 1, sy)
	elif u == max(l, r, u, d):
		print(u)
		print(sx, sy + 1)
	else:
		print(d)
		print(sx, sy - 1)


(n, z, y) = map(int, input().split(' '))
a = []
for _ in range(n):
	b = list(map(int, input().split(' ')))
	a.append(b)
suma = 0
sumb = 0
sumc = 0
sumd = 0
for x in range(0, n):
	if z - a[x][0] > 0:
		suma += 1
	if z - a[x][0] < 0:
		sumb += 1
	if y - a[x][1] > 0:
		sumc += 1
	if y - a[x][1] < 0:
		sumd += 1
if sumc >= suma and sumc >= sumb and (sumc >= sumd):
	print(sumc)
	print(f'{z} {y - 1}')
elif suma > sumb and suma > sumc and (suma > sumd):
	print(suma)
	print(f'{z - 1} {y}')
elif sumd >= suma and sumd >= sumc and (sumd >= sumb):
	print(sumd)
	print(f'{z} {y + 1}')
else:
	print(sumb)
	print(f'{z + 1} {y}')


import sys
(sx, sy) = (0, 0)
(n, sx, sy) = map(int, sys.stdin.readline().strip().split())
g = []
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	g.append([x, y])
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
(mX, mY) = (0, 0)
ans = 0
Maxi = int(1000000000.0)

def abso(x):
	return -x if x < 0 else x
for dr in range(4):
	(tentx, tenty) = (0, 0)
	tentx = sx + dx[dr]
	tenty = sy + dy[dr]
	if tentx < 0 or tentx > Maxi or tenty < 0 or (tenty > Maxi):
		continue
	cnt = 0
	for i in range(n):
		d1 = abso(g[i][0] - tentx) + abso(g[i][1] - tenty)
		d2 = abso(tentx - sx) + abso(tenty - sy)
		d3 = abso(g[i][0] - sx) + abso(g[i][1] - sy)
		if d1 + d2 == d3:
			cnt += 1
	if ans < cnt:
		ans = cnt
		mX = tentx
		mY = tenty
print(ans)
print(mX, mY)


class Input:

	def __init__(self):
		from sys import stdin
		lines = stdin.readlines()
		self.lines = list([line.rstrip('\n') for line in reversed(lines) if line != '\n'])

	def input(self):
		return self.lines.pop()

	def input_int_list(self):
		return list(map(int, self.input().split()))

	def __bool__(self):
		return bool(self.lines)
inp = Input()
(n, sx, sy) = inp.input_int_list()
right = [0, (sx + 1, sy)]
top = [0, (sx, sy + 1)]
left = [0, (sx - 1, sy)]
bottom = [0, (sx, sy - 1)]
for __ in range(n):
	(a, b) = inp.input_int_list()
	if a > sx:
		right[0] += 1
	if a < sx:
		left[0] += 1
	if b > sy:
		top[0] += 1
	if b < sy:
		bottom[0] += 1
dir = [(a, b) for (a, b) in (right, top, left, bottom)]
dir.sort()
dir.reverse()
ans = dir[0]
print(ans[0])
print(' '.join(map(str, ans[1])))


s = list(map(int, input().split()))
n = s[0]
a = s[1]
b = s[2]
p1 = p2 = p3 = p4 = 0
for i in range(n):
	q = list(map(int, input().split()))
	if q[0] < a:
		p1 += 1
	elif q[0] > a:
		p2 += 1
	if q[1] < b:
		p3 += 1
	elif q[1] > b:
		p4 += 1
x = max(p1, p2, p3, p4)
print(x)
if p1 == x:
	print(a - 1, b)
elif p2 == x:
	print(a + 1, b)
elif p3 == x:
	print(a, b - 1)
elif p4 == x:
	print(a, b + 1)


(n, x, y) = map(int, input().split())
(g_x, g_y, l_x, l_y) = (0, 0, 0, 0)
for i in range(n):
	(a, b) = map(int, input().split())
	if a > x:
		g_x += 1
	if a < x:
		l_x += 1
	if b > y:
		g_y += 1
	if b < y:
		l_y += 1
ans = max(g_x, l_x, g_y, l_y)
print(ans)
if ans == g_x:
	print(x + 1, y)
elif ans == l_x:
	print(x - 1, y)
elif ans == g_y:
	print(x, y + 1)
else:
	print(x, y - 1)


from sys import stdin, stdout

def main():
	(n, sx, sy) = map(int, input().split())
	(x, y) = ([], [])
	for i in range(n):
		(tx, ty) = map(int, stdin.readline().split())
		x.append(tx)
		y.append(ty)
	dx = [sx + 1, sx + 0, sx - 1, sx + 0]
	dy = [sy + 0, sy + 1, sy + 0, sy - 1]
	(ans, tmp) = ([0, 0, 0], 0)
	for i in range(4):
		tmp = 0
		if 0 <= dx[i] <= 1000000000 and 0 <= dy[i] <= 1000000000:
			for j in range(n):
				if x[j] >= dx[i] and i == 0:
					tmp += 1
				elif y[j] >= dy[i] and i == 1:
					tmp += 1
				elif x[j] <= dx[i] and i == 2:
					tmp += 1
				elif y[j] <= dy[i] and i == 3:
					tmp += 1
		if tmp > int(ans[0]):
			ans = [str(tmp), '\n', str(dx[i]), ' ', str(dy[i]), '\n']
	stdout.write(''.join(ans))
main()


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	(n, sx, sy) = RL()
	par = [[1, 0], [-1, 0], [0, 1], [0, -1]]
	rec = [0] * 4
	for _ in range(n):
		(x, y) = RL()
		if x > sx:
			rec[0] += 1
		elif sx > x:
			rec[1] += 1
		if y > sy:
			rec[2] += 1
		elif sy > y:
			rec[3] += 1
	res = max(rec)
	print(res)
	for i in range(4):
		if rec[i] == res:
			print(sx + par[i][0], sy + par[i][1])
			break
main()


import sys
input = sys.stdin.readline
(n, s_x, s_y) = map(int, input().split())
east = west = north = south = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x < s_x:
		west += 1
	elif x > s_x:
		east += 1
	if y < s_y:
		south += 1
	elif y > s_y:
		north += 1
ans = max([east, west, north, south])
print(ans)
if east == ans:
	print(s_x + 1, s_y)
elif west == ans:
	print(s_x - 1, s_y)
elif north == ans:
	print(s_x, s_y + 1)
else:
	print(s_x, s_y - 1)


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)
t = 1
for i in range(t):
	main()


import sys
reader = (map(int, s.split()) for s in sys.stdin)
(n, sx, sy) = next(reader)
left = right = up = down = 0
for _ in range(n):
	(xi, yi) = next(reader)
	if xi < sx:
		left += 1
	elif xi > sx:
		right += 1
	if yi > sy:
		up += 1
	elif yi < sy:
		down += 1
locs = [left, right, up, down]
idx = max(range(4), key=locs.__getitem__)
(dx, dy) = [(-1, 0), (1, 0), (0, 1), (0, -1)][idx]
print(locs[idx])
print(sx + dx, sy + dy)


(t, n, m) = map(int, input().split())
count = [0 for j in range(8)]
ans = [(n + 1, m), (n, m + 1), (n, m - 1), (n - 1, m)]
for i in range(t):
	(a, b) = map(int, input().split())
	if a > n:
		count[0] += 1
	if b > m:
		count[1] += 1
	if b < m:
		count[2] += 1
	if a < n:
		count[3] += 1
maxi = max(count)
print(maxi)
print(*ans[count.index(maxi)])


(n, sx, sy) = input().split()
n = int(n)
sx = int(sx)
sy = int(sy)

def is_along_way(a1, a2, b1, b2, c1, c2):
	x_works = a1 <= b1 and b1 <= c1 or (a1 >= b1 and b1 >= c1)
	y_works = a2 <= b2 and b2 <= c2 or (a2 >= b2 and b2 >= c2)
	if x_works and y_works:
		return 1
	else:
		return 0
houses = []
for i in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	houses.append([a, b])

def test_location(m, n):
	score = 0
	for pt in houses:
		score += is_along_way(sx, sy, m, n, pt[0], pt[1])
	return score
pos_pairs = [(sx + 1, sy), (sx - 1, sy), (sx, sy + 1), (sx, sy - 1)]
best_pair = (0, 0)
best_score = 0
for i in range(4):
	score = test_location(pos_pairs[i][0], pos_pairs[i][1])
	if score > best_score:
		best_score = score
		best_pair = pos_pairs[i]
print(best_score)
for i in range(2):
	print(best_pair[i], end=' ')


(n, sx, sy) = map(int, input().split())
xy = []
for i in range(n):
	xy.append(tuple(map(int, input().split())))
b = 0
a = 0
r = 0
l = 0
for i in xy:
	if i[0] < sx:
		l += 1
	elif i[0] > sx:
		r += 1
	if i[1] < sy:
		b += 1
	elif i[1] > sy:
		a += 1
if max(a, b, r, l) == r:
	print(r)
	print(sx + 1, sy)
elif max(a, b, r, l) == l:
	print(l)
	print(sx - 1, sy)
elif max(a, b, r, l) == a:
	print(a)
	print(sx, sy + 1)
elif max(a, b, r, l) == b:
	print(b)
	print(sx, sy - 1)


from sys import stdin
(n, sx, sy) = map(int, stdin.readline().split())
(t, b, l, r) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, stdin.readline().split())
	if x < sx:
		l += 1
	if x > sx:
		r += 1
	if y < sy:
		b += 1
	if y > sy:
		t += 1
a = [(l, (sx - 1, sy)), (r, (sx + 1, sy)), (b, (sx, sy - 1)), (t, (sx, sy + 1))]
ans = max(a)
print(ans[0])
print(*ans[1])


(n, sx, sy) = [int(x) for x in input().split()]
student = []
for i in range(n):
	student.append([int(x) for x in input().split()])
a = 0
b = 0
c = 0
d = 0
for i in student:
	x = i[0]
	y = i[1]
	if x < sx:
		a += 1
	if y < sy:
		b += 1
	if x > sx:
		c += 1
	if y > sy:
		d += 1
maxi = max(a, b, c, d)
print(maxi)
(a, b, c, d) = (0, 0, 0, 0)
for i in student:
	x = i[0]
	y = i[1]
	if x < sx:
		a += 1
		if a == maxi:
			print(sx - 1, sy)
			break
	if y < sy:
		b += 1
		if b == maxi:
			print(sx, sy - 1)
			break
	if x > sx:
		c += 1
		if c == maxi:
			print(sx + 1, sy)
			break
	if y > sy:
		d += 1
		if d == maxi:
			print(sx, sy + 1)
			break


(a, sx, sy) = map(int, input().split())
(n, s, w, e) = (0, 0, 0, 0)
for i in range(a):
	(x, y) = map(int, input().split())
	if x > sx and y > sy:
		n += 1
		e += 1
	elif x > sx and y < sy:
		s += 1
		e += 1
	elif x < sx and y < sy:
		s += 1
		w += 1
	elif x < sx and y > sy:
		n += 1
		w += 1
	elif x == sx and y > sy:
		n += 1
	elif x == sx and y < sy:
		s += 1
	elif y == sy and x > sx:
		e += 1
	elif y == sy and x < sx:
		w += 1
direc_list = [n, s, w, e]
num_ans = max(direc_list)
print(num_ans)
if direc_list.index(num_ans) == 0:
	print('{} {}'.format(sx, sy + 1))
elif direc_list.index(num_ans) == 1:
	print('{} {}'.format(sx, sy - 1))
elif direc_list.index(num_ans) == 2:
	print('{} {}'.format(sx - 1, sy))
elif direc_list.index(num_ans) == 3:
	print('{} {}'.format(sx + 1, sy))


(n, x, y) = map(int, input().split())
l = 0
r = 0
u = 0
d = 0
for i in range(n):
	(x1, y1) = map(int, input().split())
	if x1 > x:
		d = d + 1
	if x1 < x:
		u = u + 1
	if y > y1:
		l = l + 1
	if y < y1:
		r = r + 1
ans = max(l, r, u, d)
print(ans)
if ans == l:
	print(x, y - 1)
elif ans == r:
	print(x, y + 1)
elif ans == u:
	print(x - 1, y)
elif ans == d:
	print(x + 1, y)


import sys
input = sys.stdin.readline
(n, a, b) = map(int, input().split())
up = 0
left = 0
right = 0
down = 0
for i in range(n):
	(c, d) = map(int, input().split())
	if c < a:
		up += 1
	if c > a:
		down += 1
	if d < b:
		left += 1
	if d > b:
		right += 1
ma = 0
ind = [0, 0]
if a == 0 and b == 0:
	ind = [1, 1]
for i in [[1, 0, down], [-1, 0, up], [0, -1, left], [0, 1, right]]:
	aa = a + i[0]
	bb = b + i[1]
	if aa < 0 or bb < 0 or aa > 10 ** 9 or (bb > 10 ** 9):
		continue
	if i[2] > ma:
		ma = i[2]
		ind = [aa, bb]
print(ma)
print(*ind)


(n, sx, sy) = list(map(int, input().strip().split()))
students = []
for _ in range(n):
	(x, y) = list(map(int, input().strip().split()))
	students.append((x, y))
from collections import defaultdict
up = 0
down = 0
left = 0
right = 0
for (x, y) in students:
	if y > sy:
		up += 1
	if y < sy:
		down += 1
	if x < sx:
		left += 1
	if x > sx:
		right += 1
sez = [up, down, left, right]
maks = max((up, down, left, right))
index = sez.index(maks)
print(maks)
if index == 0:
	print(sx, sy + 1)
elif index == 1:
	print(sx, sy - 1)
elif index == 2:
	print(sx - 1, sy)
else:
	print(sx + 1, sy)


import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
(n, sx, sy) = [int(x) for x in input().split()]
px = [0, 0]
py = [0, 0]
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	if x < sx:
		px[0] += 1
	elif x > sx:
		px[1] += 1
	if y < sy:
		py[0] += 1
	elif y > sy:
		py[1] += 1
m = max(max(px), max(py))
print(m)
if m == px[0]:
	print(sx - 1, sy)
elif m == px[1]:
	print(sx + 1, sy)
elif m == py[0]:
	print(sx, sy - 1)
else:
	print(sx, sy + 1)


from sys import stdin

def counter(c):
	if c == 'B':
		return 'W'
	return 'B'
(n, sx, sy) = list(map(int, stdin.readline().split()))
less_y = 0
less_x = 0
more_x = 0
more_y = 0
for _ in range(n):
	(x, y) = list(map(int, stdin.readline().split()))
	x -= sx
	y -= sy
	if x < 0:
		less_x += 1
	if x > 0:
		more_x += 1
	if y < 0:
		less_y += 1
	if y > 0:
		more_y += 1
ans = 0
ax = 0
ay = -1
if ans < more_y:
	ans = more_y
	ax = 0
	ay = 1
if ans < less_y:
	ans = less_y
	ax = 0
	ay = -1
if ans < more_x:
	ans = more_x
	ax = 1
	ay = 0
if ans < less_x:
	ans = less_x
	ax = -1
	ay = 0
print(ans)
print(ax + sx, ay + sy)


(n, x, y) = map(int, input().split())
lu = 0
ld = 0
ru = 0
rd = 0
u = 0
d = 0
l = 0
r = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if a < x and b < y:
		ld += 1
	elif a < x and b > y:
		lu += 1
	elif a == x and b != y:
		if b > y:
			u += 1
		else:
			d += 1
	elif a > x and b < y:
		rd += 1
	elif a > x and b > y:
		ru += 1
	elif a != x and b == y:
		if a < x:
			l += 1
		else:
			r += 1
l1 = []
l1.append(lu + ru + u)
l1.append(lu + ld + l)
l1.append(ru + rd + r)
l1.append(ld + rd + d)
ans = max(l1)
ind = l1.index(max(l1))
print(ans)
if ind == 0:
	print(x, y + 1)
elif ind == 1:
	print(x - 1, y)
elif ind == 2:
	print(x + 1, y)
else:
	print(x, y - 1)


(a, b, c) = map(int, input().split())
(l, r, u1, d1) = (0, 0, 0, 0)
for _ in ' ' * a:
	(u, v) = map(int, input().split())
	if u == b:
		if v < c:
			l += 1
		else:
			r += 1
	elif v == c:
		if u < b:
			u1 += 1
		else:
			d1 += 1
	elif u > b and v < c:
		l += 1
		d1 += 1
	elif u < b and v < c:
		l += 1
		u1 += 1
	elif u < b and v > c:
		u1 += 1
		r += 1
	else:
		d1 += 1
		r += 1
print(max(l, r, d1, u1))
if max(l, r, d1, u1) == l:
	print(b, c - 1)
elif max(l, r, d1, u1) == r:
	print(b, c + 1)
elif max(l, r, d1, u1) == u1:
	print(b - 1, c)
else:
	print(b + 1, c)


import sys
input = sys.stdin.readlines
lines = input()
lines.reverse()
x_plus = 0
top_right = 0
y_plus = 0
top_left = 0
x_min = 0
bottom_left = 0
y_min = 0
bottom_right = 0
(n, s_x, s_y) = map(int, lines.pop().split())
for i in range(n):
	(h_x, h_y) = map(int, lines.pop().split())
	if h_x > s_x and h_y == s_y:
		x_plus += 1
	elif h_x > s_x and h_y > s_y:
		top_right += 1
	elif h_x == s_x and h_y > s_y:
		y_plus += 1
	elif h_x < s_x and h_y > s_y:
		top_left += 1
	elif h_x < s_x and h_y == s_y:
		x_min += 1
	elif h_x < s_x and h_y < s_y:
		bottom_left += 1
	elif h_x == s_x and h_y < s_y:
		y_min += 1
	elif h_x > s_x and h_y < s_y:
		bottom_right += 1
right = x_plus + top_right + bottom_right
up = y_plus + top_right + top_left
left = x_min + top_left + bottom_left
down = y_min + bottom_left + bottom_right
most_houses = max(right, up, left, down)
print(most_houses)
if most_houses == right:
	print(s_x + 1, s_y)
elif most_houses == up:
	print(s_x, s_y + 1)
elif most_houses == left:
	print(s_x - 1, s_y)
elif most_houses == down:
	print(s_x, s_y - 1)


import math
(n, sx, sy) = map(int, input().strip().split(' '))
r = 0
l = 0
u = 0
d = 0
for i in range(n):
	(hx, hy) = map(int, input().strip().split(' '))
	if hx > sx:
		r += 1
	if hx < sx:
		l += 1
	if hy > sy:
		u += 1
	if hy < sy:
		d += 1
m = max(u, d, l, r)
if u == m:
	print(u)
	print(sx, sy + 1, end=' ')
	print()
elif d == m:
	print(d)
	print(sx, sy - 1, end=' ')
	print()
elif l == m:
	print(l)
	print(sx - 1, sy, end=' ')
	print()
elif r == m:
	print(r)
	print(sx + 1, sy, end=' ')
	print()


(n, sx, sy) = map(int, input().split())
q = [[[], []], [[], []], [[], []], [[], []]]
l = [[[], []], [[], []], [[], []], [[], []]]
for i in range(n):
	(a, b) = map(int, input().split())
	if a < sx and b > sy:
		q[0][0].append(a)
		q[0][1].append(b)
	if a > sx and b > sy:
		q[1][0].append(a)
		q[1][1].append(b)
	if a < sx and b < sy:
		q[3][0].append(a)
		q[3][1].append(b)
	if a > sx and b < sy:
		q[2][0].append(a)
		q[2][1].append(b)
	if a == sx:
		if b > sy:
			l[0][0].append(a)
			l[0][1].append(b)
		else:
			l[2][0].append(a)
			l[2][1].append(b)
	if b == sy:
		if a > sx:
			l[1][0].append(a)
			l[1][1].append(b)
		else:
			l[3][0].append(a)
			l[3][1].append(b)
len_ = [len(q[i][0]) + len(l[i][0]) + len(q[(i + 1) % 4][0]) for i in range(4)]
print(max(len_))
idx = len_.index(max(len_))
if idx == 0:
	print(sx, sy + 1)
elif idx == 1:
	print(sx + 1, sy)
elif idx == 2:
	print(sx, sy - 1)
elif idx == 3:
	print(sx - 1, sy)


(n, sx, sy) = [int(x) for x in input().split()]
d = {}
if sx >= 1 and sy >= 1:
	d[sx - 1, sy] = 0
	d[sx, sy - 1] = 0
elif sx == 0:
	d[sx, sy - 1] = 0
else:
	d[sx - 1, sy] = 0
if sx < 1000000000 and sy < 1000000000:
	d[sx, sy + 1] = 0
	d[sx + 1, sy] = 0
elif sx == 1000000000:
	d[sx, sy + 1] = 0
else:
	d[sx + 1, sy] = 0
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	if x > sx and y > sy:
		d[sx, sy + 1] += 1
		d[sx + 1, sy] += 1
	elif x < sx and y > sy:
		d[sx, sy + 1] += 1
		d[sx - 1, sy] += 1
	elif x > sx and y < sy:
		d[sx + 1, sy] += 1
		d[sx, sy - 1] += 1
	elif x < sx and y < sy:
		d[sx - 1, sy] += 1
		d[sx, sy - 1] += 1
	elif x == sx and y > sy:
		d[sx, sy + 1] += 1
	elif x == sx and y < sy:
		d[sx, sy - 1] += 1
	elif y == sy and x > sx:
		d[sx + 1, sy] += 1
	else:
		d[sx - 1, sy] += 1
max = 0
for i in d.keys():
	if d[i] > max:
		max = d[i]
		ans = i
print(max)
print(str(ans[0]) + ' ' + str(ans[1]))


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
		elif cright >= rdown:
			ans[1] += 1
			count = cright
		else:
			ans[0] += 1
			count = rdown
	elif rup >= rdown:
		if cleft >= rup:
			ans[1] -= 1
			count = cleft
		else:
			ans[0] -= 1
			count = rup
	elif 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()


import sys
(n, sx, sy) = map(int, input().split())

def f(n):
	n = str(n)[0]
	if n == '0':
		return 0
	if n[0] == '-':
		return -1
	return 1

def can_reach(x, y, tx, ty):
	if ty > 0 and y < 0:
		return False
	if ty < 0 and y > 0:
		return False
	if tx > 0 and x < 0:
		return False
	if tx < 0 and x > 0:
		return False
	(x, y, tx, ty) = map(abs, [x, y, tx, ty])
	return 0 <= ty <= y and 0 <= tx <= x

def main():
	d = {(-1, -1): 0, (-1, 0): 0, (-1, 1): 0, (0, -1): 0, (0, 1): 0, (1, -1): 0, (1, 0): 0, (1, 1): 0}
	for _ in range(n):
		(x, y) = sys.stdin.readline().split()
		x = f(int(x) - sx)
		y = f(int(y) - sy)
		d[x, y] += 1

	def count(tx, ty, d):
		c = 0
		for (t, cu) in d.items():
			(x, y) = (t[0], t[1])
			if can_reach(x, y, tx, ty):
				c += cu
		return c
	points = [[a, b] for a in range(-1, 2) for b in range(-1, 2) if a != 0 or b != 0]
	(mc, ax, ay) = (-1, -10, -10)
	for (x, y) in points:
		c = count(x, y, d)
		if c > mc:
			mc = c
			ax = x
			ay = y
	print(mc)
	print(ax + sx, ay + sy)
main()


(n, sx, sy) = map(int, input().split())
left = 0
right = 0
up = 0
down = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		right += 1
	if x < sx:
		left += 1
	if y > sy:
		up += 1
	if y < sy:
		down += 1
out = max(left, right, up, down)
print(out)
if out == left:
	print(sx - 1, sy)
elif out == right:
	print(sx + 1, sy)
elif out == up:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


(p, sx, sy) = [int(n) for n in input().split()]
ps = [[int(n) for n in input().split()] for _ in range(p)]
arrs = [((sx + 1, sy), len([p for p in ps if p[0] >= sx + 1])), ((sx - 1, sy), len([p for p in ps if p[0] <= sx - 1])), ((sx, sy + 1), len([p for p in ps if p[1] >= sy + 1])), ((sx, sy - 1), len([p for p in ps if p[1] <= sy - 1]))]
winner = sorted(arrs, key=lambda a: a[1])[-1]
print(winner[1])
print(*winner[0])


from sys import stdin
(n, x, y) = map(int, input().split())
coor = [0, 0, 0, 0]
for line in stdin:
	(sx, sy) = [int(i) for i in line[:-1].split()]
	if sx == x:
		if sy < y:
			coor[0] += 1
		else:
			coor[2] += 1
	elif sy == y:
		if sx < x:
			coor[1] += 1
		elif sx > x:
			coor[3] += 1
	elif sx < x:
		if sy < y:
			coor[0] += 1
			coor[1] += 1
		else:
			coor[1] += 1
			coor[2] += 1
	elif sx > x:
		if sy < y:
			coor[0] += 1
			coor[3] += 1
		else:
			coor[3] += 1
			coor[2] += 1
mc = max(coor)
if mc == coor[0]:
	y -= 1
elif mc == coor[1]:
	x -= 1
elif mc == coor[2]:
	y += 1
else:
	x += 1
print(mc)
print(x, y)


(n, x0, y0) = list(map(int, input().split()))
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
ans = []
m = 0
y = 10 ** 9
for i in range(n):
	if l[i][1] > y0:
		m = m + 1
		y = min(y, l[i][1])
ans.append([m, x0, y])
m = 0
y = 0
for i in range(n):
	if l[i][1] < y0:
		m = m + 1
		y = max(y, l[i][1])
ans.append([m, x0, y])
m = 0
x = 10 ** 9
for i in range(n):
	if l[i][0] > x0:
		m = m + 1
		x = min(x, l[i][0])
ans.append([m, x, y0])
m = 0
x = 0
for i in range(n):
	if l[i][0] < x0:
		m = m + 1
		x = max(x, l[i][0])
ans.append([m, x, y0])
ans.sort()
print(ans[-1][0])
print(ans[-1][1], ans[-1][2])


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
input_a = lambda fun: map(fun, stdin.readline().split())
(n, x, y) = input_a(int)
(right, up, left, down) = (0, 0, 0, 0)
for i in range(n):
	(xi, yi) = input_a(int)
	if xi > x:
		right += 1
	if yi > y:
		up += 1
	if xi < x:
		left += 1
	if yi < y:
		down += 1
c = max(right, up, left, down)
print(c)
if right == c:
	print(x + 1, y)
elif up == c:
	print(x, y + 1)
elif left == c:
	print(x - 1, y)
elif down == c:
	print(x, y - 1)


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
mu = 0
ms = 0
hu = 0
hs = 0
m = 0
h = 0
u = 0
s = 0
sxsy = 0
for i in range(n):
	if l[i][0] == sx and l[i][1] == sy:
		sxsy += 1
	elif l[i][0] == sx and l[i][1] < sy:
		s += 1
	elif l[i][0] == sx and l[i][1] > sy:
		u += 1
	elif l[i][0] < sx and l[i][1] == sy:
		h += 1
	elif l[i][0] > sx and l[i][1] == sy:
		m += 1
	elif l[i][0] > sx and l[i][1] > sy:
		mu += 1
	elif l[i][0] < sx and l[i][1] > sy:
		hu += 1
	elif l[i][0] > sx and l[i][1] < sy:
		ms += 1
	else:
		hs += 1
ans = [0] * 4
ans[0] = u + mu + hu
ans[1] = h + hu + hs
ans[2] = s + ms + hs
ans[3] = m + ms + mu
mans = max(ans)
md = ans.index(mans)
if md == 0:
	print(mans + sxsy)
	print(sx, sy + 1)
elif md == 1:
	print(mans + sxsy)
	print(sx - 1, sy)
elif md == 2:
	print(mans + sxsy)
	print(sx, sy - 1)
else:
	print(mans + sxsy)
	print(sx + 1, sy)


(n, x, y) = list(map(int, input().split()))
l = []
for _ in range(n):
	l.append(list(map(int, input().split())))
p1 = [x - 1, y]
p2 = [x, y + 1]
p3 = [x + 1, y]
p4 = [x, y - 1]
a1 = 0
a2 = 0
a3 = 0
a4 = 0
for i in l:
	if i[0] <= p1[0]:
		a1 += 1
	if i[1] >= p2[1]:
		a2 += 1
	if i[0] >= p3[0]:
		a3 += 1
	if i[1] <= p4[1]:
		a4 += 1
th = max(a1, a2, a3, a4)
print(th)
if a1 == th:
	print(*p1)
elif a2 == th:
	print(*p2)
elif a3 == th:
	print(*p3)
elif a4 == th:
	print(*p4)


import sys

def kek():
	(n, sx, sy) = list(map(int, input().split()))
	(u, d, l, r) = (0, 0, 0, 0)
	for i in range(n):
		(x, y) = map(int, sys.stdin.readline().split())
		if x > sx:
			u += 1
		if x < sx:
			d += 1
		if y > sy:
			r += 1
		if y < sy:
			l += 1
	maxX = max(u, d, l, r)
	print(maxX)
	if maxX == u:
		print(sx + 1, sy)
	elif maxX == d:
		print(sx - 1, sy)
	elif maxX == l:
		print(sx, sy - 1)
	elif maxX == r:
		print(sx, sy + 1)
kek()


import sys
input = sys.stdin.readline
(n, sx, sy) = [int(x) for x in input().split()]
(l, r, u, d) = [0, 0, 0, 0]
(lmax, rmin, dmax, umin) = [0, 10 ** 10, 0, 10 ** 10]
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	if x < sx:
		l += 1
	elif x > sx:
		r += 1
	if y < sy:
		d += 1
	elif y > sy:
		u += 1
m = max(l, r, u, d)
print(m)
if m == l:
	print(sx - 1, sy)
elif m == r:
	print(sx + 1, sy)
elif m == u:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


def maxi(l, sx, sy):
	ans = l[0]
	index = 0
	for i in range(4):
		if l[i] > ans:
			ans = l[i]
			index = i
	if index == 0:
		return (ans, sx + 1, sy)
	elif index == 1:
		return (ans, sx, sy + 1)
	elif index == 2:
		return (ans, sx - 1, sy)
	else:
		return (ans, sx, sy - 1)
(n, sx, sy) = [int(x) for x in input().split()]
count = {'1': 0, '2': 0, '3': 0, '4': 0, 'xplus': 0, 'xminus': 0, 'yplus': 0, 'yminus': 0}
for i in range(n):
	(px, py) = [int(x) for x in input().split()]
	prx = px - sx
	pry = py - sy
	if prx > 0 and pry > 0:
		count['1'] += 1
	elif prx < 0 and pry > 0:
		count['2'] += 1
	elif prx < 0 and pry < 0:
		count['3'] += 1
	elif prx > 0 and pry < 0:
		count['4'] += 1
	elif prx > 0 and pry == 0:
		count['xplus'] += 1
	elif prx < 0 and pry == 0:
		count['xminus'] += 1
	elif prx == 0 and pry > 0:
		count['yplus'] += 1
	elif prx == 0 and pry < 0:
		count['yminus'] += 1
(ans, cx, cy) = maxi([count['1'] + count['xplus'] + count['4'], count['1'] + count['yplus'] + count['2'], count['2'] + count['xminus'] + count['3'], count['3'] + count['yminus'] + count['4']], sx, sy)
print(ans)
print(cx, cy)


(n, sx, sy) = map(int, input().split())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	a = a - sx
	b = b - sy
	l.append((a, b))
p = 0
q = 0
r = 0
s = 0
for i in l:
	if i[0] > 0:
		p += 1
	if i[1] > 0:
		q += 1
	if i[0] < 0:
		r += 1
	if i[1] < 0:
		s += 1
m = max(p, q, r, s)
print(m)
if m == s:
	print(sx, sy - 1, end=' ')
elif m == r:
	print(sx - 1, sy, end=' ')
elif m == q:
	print(sx, sy + 1, end=' ')
else:
	print(sx + 1, sy, end=' ')


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
c = [0] * 9
(n, sx, sy) = mints()
for i in range(n):
	(x, y) = mints()
	x -= sx
	y -= sy
	k = 0
	if x < 0:
		k += 0
	elif x == 0:
		k += 1
	else:
		k += 2
	if y < 0:
		k += 0
	elif y == 0:
		k += 3
	else:
		k += 6
	c[k] += 1
r = (-1, sx, sy)
if sx - 1 >= 0 and sy - 1 >= 0:
	r = max(r, (c[0], sx - 1, sy - 1))
if sy - 1 >= 0:
	r = max(r, (c[0] + c[1] + c[2], sx, sy - 1))
if sx + 1 <= int(1000000000.0) and sy - 1 >= 0:
	r = max(r, (c[2], sx + 1, sy - 1))
if sx + 1 <= int(1000000000.0):
	r = max(r, (c[2] + c[5] + c[8], sx + 1, sy))
if sx + 1 <= int(1000000000.0) and sy + 1 <= int(1000000000.0):
	r = max(r, (c[8], sx + 1, sy + 1))
if sy + 1 <= int(1000000000.0):
	r = max(r, (c[6] + c[7] + c[8], sx, sy + 1))
if sy + 1 <= int(1000000000.0) and sx - 1 >= 0:
	r = max(r, (c[6], sx - 1, sy + 1))
if sx - 1 >= 0:
	r = max(r, (c[0] + c[3] + c[6], sx - 1, sy))
print(r[0])
print(r[1], r[2])


(n, s0, s1) = [int(s) for s in input().split()]
count = [0, 0, 0, 0]
for i in range(n):
	(x, y) = [int(s) for s in input().split()]
	count[0] += x < s0
	count[1] += x > s0
	count[2] += y < s1
	count[3] += y > s1
win = max(count)
print(win)
if count[0] == win:
	print('{} {}'.format(s0 - 1, s1))
elif count[1] == win:
	print('{} {}'.format(s0 + 1, s1))
elif count[2] == win:
	print('{} {}'.format(s0, s1 - 1))
else:
	print('{} {}'.format(s0, s1 + 1))


(N, sx, sy) = map(int, input().split())
cnt = [0] * 4
for i in range(N):
	(x, y) = map(int, input().split())
	cnt[0] += y < sy
	cnt[1] += x < sx
	cnt[2] += y > sy
	cnt[3] += x > sx
ans = 0
cur = 0
dy = [-1, 0, 1, 0]
dx = [0, -1, 0, 1]
for i in range(4):
	if ans < cnt[i]:
		ans = cnt[i]
		cur = i
print(ans)
print(sx + dx[cur], sy + dy[cur])


(a, b, c) = map(int, input().split())
t = (b, c)
lst_left = []
lst_right = []
lst_up = []
lst_down = []
for i in range(a):
	(n, m) = map(int, input().split())
	if n > b:
		lst_right.append((n, m))
	if n < b:
		lst_left.append((n, m))
	if m > c:
		lst_up.append((n, m))
	if m < c:
		lst_down.append((n, m))
lst = [len(lst_left), len(lst_right), len(lst_up), len(lst_down)]
batman = max(lst)
print(batman)
if batman == lst[0]:
	b -= 1
elif batman == lst[1]:
	b += 1
elif batman == lst[2]:
	c += 1
elif batman == lst[3]:
	c -= 1
print(b, c)


(n, sx, sy) = (int(i) for i in input().split())
(c1, c2, c3, c4) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = (int(i) for i in input().split())
	if x < sx:
		c1 += 1
	elif x > sx:
		c2 += 1
	if y > sy:
		c3 += 1
	elif y < sy:
		c4 += 1
k = max(c1, c2, c3, c4)
print(k)
if k == c1:
	print(sx - 1, sy)
elif k == c2:
	print(sx + 1, sy)
elif k == c3:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations, permutations
from bisect import *
from fractions import Fraction
from heapq import *
from random import randint

def main():
	(n, u, v) = map(int, input().split())
	(a, b, c, d, e, f, g, h) = (0, 0, 0, 0, 0, 0, 0, 0)
	for i in range(n):
		(x, y) = map(int, input().split())
		x -= u
		y -= v
		if x > 0 and y > 0:
			a += 1
		elif x < 0 and y > 0:
			b += 1
		elif x < 0 and y < 0:
			c += 1
		elif x > 0 and y < 0:
			d += 1
		elif y == 0 and x > 0:
			e += 1
		elif y == 0 and x < 0:
			f += 1
		elif x == 0 and y > 0:
			g += 1
		else:
			h += 1
	z = [(e + a + d, 1, 0), (f + b + c, -1, 0), (g + a + b, 0, 1), (h + c + d, 0, -1)]
	ma = max(z, key=lambda x: x[0])
	print(ma[0])
	print(ma[1] + u, ma[2] + v)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
(n, sx, sy) = map(int, sys.stdin.readline().strip().split())
g = []
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	g.append([x, y])
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
ans = 0
(mX, mY) = (0, 0)
for dr in range(4):
	tentx = int(sx + dx[dr])
	tenty = int(sy + dy[dr])
	if tentx < 0 or tentx > int(1000000000.0) or tenty < 0 or (tenty > int(1000000000.0)):
		continue
	cnt = 0
	for i in range(n):
		curx = int(g[i][0])
		cury = int(g[i][1])
		(dx1, dx2, dx3) = (0, 0, 0)
		(dy1, dy2, dy3) = (0, 0, 0)
		if curx - tentx < 0:
			dx1 = tentx - curx
		else:
			dx1 = curx - tentx
		if cury - tenty < 0:
			dy1 = tenty - cury
		else:
			dy1 = cury - tenty
		if tentx - sx > 0:
			dx2 = tentx - sx
		else:
			dx2 = sx - tentx
		if tenty - sy > 0:
			dy2 = tenty - sy
		else:
			dy2 = sy - tenty
		if curx - sx > 0:
			dx3 = curx - sx
		else:
			dx3 = sx - curx
		if cury - sy > 0:
			dy3 = cury - sy
		else:
			dy3 = sy - cury
		if dx1 + dy1 + dx2 + dy2 == dx3 + dy3:
			cnt += 1
	if ans < cnt:
		ans = cnt
		mX = tentx
		mY = tenty
print(ans)
print(mX, mY)


import sys
(n, sx, sy) = map(int, input().split())
u = 0
d = 0
l = 0
r = 0
for line in sys.stdin:
	(x, y) = map(int, line.split())
	if x > sx:
		r += 1
	elif x < sx:
		l += 1
	if y > sy:
		u += 1
	elif y < sy:
		d += 1
maxi = max(u, d, l, r)
print(maxi)
if u == maxi:
	print(sx, sy + 1)
elif d == maxi:
	print(sx, sy - 1)
elif l == maxi:
	print(sx - 1, sy)
else:
	print(sx + 1, sy)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def lessThanX(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def BinarySearch(a, x):
	i = bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def main():
	(n, s1, s2) = ei()
	(l, r, u, d) = (0, 0, 0, 0)
	for i in range(n):
		(x, y) = ei()
		if x > s1:
			r += 1
		elif x < s1:
			l += 1
		if y > s2:
			u += 1
		elif y < s2:
			d += 1
	ans = max([l, r, u, d])
	print(ans)
	if ans == r:
		print(s1 + 1, s2)
	elif ans == l:
		print(s1 - 1, s2)
	elif ans == u:
		print(s1, s2 + 1)
	else:
		print(s1, s2 - 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
ip = lambda : int(sys.stdin.readline().rstrip('\r\n'))
ai = lambda : list(map(int, sys.stdin.readline().split()))
ei = lambda : map(int, sys.stdin.readline().split())
main()


def solution(test_input, sx, sy):
	directions = [[-1, 0], [0, -1], [1, 0], [0, 1]]
	points = 0
	coordinate = [0, 0]
	for direction in directions:
		px = sx + direction[0]
		py = sy + direction[1]
		local_points = 0
		for test in test_input:
			x = test[0]
			y = test[1]
			if (px - sx) * (px - x) <= 0 and (py - sy) * (py - y) <= 0:
				local_points += 1
		if local_points > points:
			points = local_points
			coordinate = [px, py]
	print(points)
	print(coordinate[0], coordinate[1])
(n, sx, sy) = [int(x) for x in input().split()]
test_input = []
for i in range(n):
	ar = [int(x) for x in input().split()]
	test_input.append(ar)
solution(test_input, sx, sy)


z = 1
z = 0
if z > 0:
	import sys
	sys.stdin = open('input.txt', 'r')
(n, sx, sy) = map(int, input().split())
d = [0, 0, 0, 0]
c = [(sx - 1, sy), (sx, sy + 1), (sx + 1, sy), (sx, sy - 1)]
for _ in range(n):
	(x, y) = map(int, input().split())
	x -= sx
	y -= sy
	d[0] += x < 0
	d[1] += y > 0
	d[3] += y < 0
	d[2] += x > 0
i = d.index(max(d))
print(d[i])
print(*c[i])


(n, sx, sy) = map(int, input().split())
u = 0
r = 0
l = 0
d = 0
for _ in range(n):
	(cx, cy) = map(int, input().split())
	if cx > sx:
		r += 1
	if cx < sx:
		l += 1
	if cy > sy:
		u += 1
	if cy < sy:
		d += 1
ans = max(u, r, l, d)
print(ans)
if ans == u:
	print(sx, sy + 1)
elif ans == r:
	print(sx + 1, sy)
elif ans == l:
	print(sx - 1, sy)
elif ans == d:
	print(sx, sy - 1)


import sys
sx = [0, 0]
(n, sx[0], sx[1]) = map(int, sys.stdin.readline().strip().split())
g = [[0, 0] for i in range(n)]

def getDistance(x, y):
	return abs(x[0] - y[0]) + abs(x[1] - y[1])
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	g[i][0] = x
	g[i][1] = y
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
maxDist = [0, 0]
ans = 0
for dr in range(4):
	tent = [sx[0], sx[1]]
	tent[0] += dx[dr]
	tent[1] += dy[dr]
	if tent[0] < 0 or tent[0] > int(1000000000.0) or tent[1] < 0 or (tent[1] > int(1000000000.0)):
		continue
	cnt = 0
	for i in range(n):
		if getDistance(g[i], tent) + getDistance(tent, sx) == getDistance(g[i], sx):
			cnt += 1
	if ans < cnt:
		ans = cnt
		maxDist[0] = tent[0]
		maxDist[1] = tent[1]
print(ans)
print(maxDist[0], maxDist[1])


(n, x, y) = map(int, input().split())
(l, r, u, d) = (0, 0, 0, 0)
for _ in range(n):
	(j, k) = map(int, input().split())
	if j < x:
		l += 1
	elif j > x:
		r += 1
	if k > y:
		u += 1
	elif k < y:
		d += 1
mx = max(l, r, u, d)
if l == mx:
	x -= 1
elif r == mx:
	x += 1
elif u == mx:
	y += 1
else:
	y -= 1
print(mx)
print(x, y)


(n, xs, ys) = [int(element) for element in input().split(' ')]
liste = []
for iteration in range(n):
	(x, y) = [int(element) for element in input().split(' ')]
	liste.append((x, y))
best_coord = [(xs, ys + 1), (xs - 1, ys), (xs, ys - 1), (xs + 1, ys)]
max_outreach = [0, 0, 0, 0]
for i in range(len(liste)):
	(x, y) = liste[i]
	if y > ys:
		max_outreach[0] += 1
	if x < xs:
		max_outreach[1] += 1
	if y < ys:
		max_outreach[2] += 1
	if x > xs:
		max_outreach[3] += 1
m = max(max_outreach)
for i in range(4):
	if m == max_outreach[i]:
		(x, y) = best_coord[i]
		break
print(str(m) + '\n' + str(x) + ' ' + str(y))


(n, x, y) = map(int, input().split())
list1 = list()
list2 = list()
list3 = list()
list4 = list()
sum = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if a > x and b > y:
		list1.append([a, b])
		list2.append([a, b])
	if a > x and b < y:
		list2.append([a, b])
		list3.append([a, b])
	if a < x and b > y:
		list4.append([a, b])
		list1.append([a, b])
	if a < x and b < y:
		list3.append([a, b])
		list4.append([a, b])
	if a == x:
		if b > y:
			list1.append([a, b])
		else:
			list3.append([a, b])
	if b == y:
		if a > x:
			list2.append([a, b])
		else:
			list4.append([a, b])
maximum = -1
t = [len(list1), len(list2), len(list3), len(list4)]
p = -1
for i in range(len(t)):
	if maximum < t[i]:
		maximum = t[i]
		p = i
print(maximum)
if p == 0:
	print(x, y + 1)
elif p == 1:
	print(x + 1, y)
elif p == 2:
	print(x, y - 1)
else:
	print(x - 1, y)


(a, sx, sy) = map(int, input().split())
xy = []
for i in range(a):
	xy.append(tuple(map(int, input().split())))
c = 0
c1 = 0
p = 0
p1 = 0
ar = [0, 0, 0, 0]
for i in xy:
	if i[0] > sx:
		ar[0] += 1
	if i[1] > sy:
		ar[1] += 1
	if i[0] < sx:
		ar[2] += 1
	if i[1] < sy:
		ar[3] += 1
ar = list(enumerate(ar))
z = sorted(ar, reverse=True, key=lambda x: x[1])
if z[0][0] == 0:
	print(ar[0][1])
	print(sx + 1, sy)
elif z[0][0] == 1:
	print(ar[1][1])
	print(sx, sy + 1)
elif z[0][0] == 2:
	print(ar[2][1])
	print(sx - 1, sy)
elif z[0][0] == 3:
	print(ar[3][1])
	print(sx, sy - 1)


(n, a, b) = map(int, input().split())
l = [tuple(map(int, input().split())) for _ in range(n)]
q = []
(c1, c2, c3, c4) = (0, 0, 0, 0)
for (x, y) in l:
	if x > a:
		c1 += 1
	if x < a:
		c2 += 1
	if y > b:
		c3 += 1
	if y < b:
		c4 += 1
s = max(c1, c2, c3, c4)
if s == c1:
	print(c1)
	print(a + 1, b)
elif s == c2:
	print(c2)
	print(a - 1, b)
elif s == c3:
	print(c3)
	print(a, b + 1)
else:
	print(c4)
	print(a, b - 1)


from operator import itemgetter
line = input().split()
N = int(line[0])
Sx = int(line[1])
Sy = int(line[2])
arrX = [0] * N
arrY = [0] * N
for i in range(N):
	line = input().split()
	arrX[i] = int(line[0])
	arrY[i] = int(line[1])
sortX = sorted(arrX)
sortY = sorted(arrY)
M = 0
P = [0] * 2
for i in range(N):
	if sortX[i] > Sx:
		C = N - i
		if C > M:
			M = C
			P[0] = sortX[i]
			P[1] = Sy
	if sortX[i] < Sx:
		C = i + 1
		if C > M:
			M = C
			P[0] = sortX[i]
			P[1] = Sy
for i in range(N):
	if sortY[i] > Sy:
		C = N - i
		if C > M:
			M = C
			P[0] = Sx
			P[1] = sortY[i]
	if sortY[i] < Sy:
		C = i + 1
		if C > M:
			M = C
			P[0] = Sx
			P[1] = sortY[i]
print(M)
print(P[0], P[1])


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
(n, sx, sy) = [int(x) for x in input().split()]
l = 0
r = 0
t = 0
b = 0
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	if x < sx:
		l -= -1
	if x > sx:
		r -= -1
	if y > sy:
		t -= -1
	if y < sy:
		b -= -1
m = max(l, r, t, b)
print(m)
if m == l:
	print(sx - 1, sy)
elif m == r:
	print(sx + 1, sy)
elif m == t:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


(n, a, b) = map(int, input().split())
graph = []
for i in range(n):
	(c, d) = map(int, input().split())
	graph.append([c, d])
ans1 = [0, a - 1, b]
for i in range(n):
	if graph[i][0] < a:
		ans1[0] += 1
ans2 = [0, a, b + 1]
for i in range(n):
	if graph[i][1] > b:
		ans2[0] += 1
ans3 = [0, a + 1, b]
for i in range(n):
	if graph[i][0] > a:
		ans3[0] += 1
ans4 = [0, a, b - 1]
for i in range(n):
	if graph[i][1] < b:
		ans4[0] += 1
print(max(ans1[0], ans2[0], ans3[0], ans4[0]))
if max(ans1[0], ans2[0], ans3[0], ans4[0]) == ans1[0]:
	print(ans1[1], ans1[2])
elif max(ans1[0], ans2[0], ans3[0], ans4[0]) == ans2[0]:
	print(ans2[1], ans2[2])
elif max(ans1[0], ans2[0], ans3[0], ans4[0]) == ans3[0]:
	print(ans3[1], ans3[2])
elif max(ans1[0], ans2[0], ans3[0], ans4[0]) == ans4[0]:
	print(ans4[1], ans4[2])


from math import *
first = input().split(' ')
q = int(first[0])
sx = int(first[1])
sy = int(first[2])
sta = []
sts = []
first = 0
second = 0
third = 0
fourth = 0
for x in range(0, q):
	sta.append(input().split(' '))
	if int(sta[x][1]) > sy:
		first = first + 1
	if int(sta[x][0]) < sx:
		second = second + 1
	if int(sta[x][1]) < sy:
		third = third + 1
	if int(sta[x][0]) > sx:
		fourth = fourth + 1
n = max(first, second, third, fourth)
if n == first:
	print(n)
	print(sx, sy + 1)
elif n == second:
	print(n)
	print(sx - 1, sy)
elif n == third:
	print(n)
	print(sx, sy - 1)
elif n == fourth:
	print(n)
	print(sx + 1, sy)


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	if x <= sx - 1:
		a += 1
	elif x >= sx + 1:
		b += 1
	if y <= sy - 1:
		c += 1
	elif y >= sy + 1:
		d += 1
m = max(a, b, c, d)
print(m)
if a == m:
	print(sx - 1, sy)
elif b == m:
	print(sx + 1, sy)
elif c == m:
	print(sx, sy - 1)
else:
	print(sx, sy + 1)


r = lambda : list(map(int, input().split()))
(n, sx, sy) = r()
(cxp, cxn, cyp, cyn) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = r()
	if x > sx:
		cxp += 1
	elif x < sx:
		cxn += 1
	if y > sy:
		cyp += 1
	elif y < sy:
		cyn += 1
g = max(cxp, cxn, cyp, cyn)
print(g)
if g == cxp:
	sx += 1
elif g == cxn:
	sx -= 1
elif g == cyp:
	sy += 1
elif g == cyn:
	sy -= 1
print(sx, sy)


import math

def main():
	(n, xs, ys) = tuple([int(x) for x in input().split()])
	p1 = 0
	p2 = 0
	p3 = 0
	p4 = 0
	for i in range(n):
		(x, y) = tuple([int(x) for x in input().split()])
		if x < xs:
			p1 += 1
		if x > xs:
			p2 += 1
		if y < ys:
			p3 += 1
		if y > ys:
			p4 += 1
	p = max(p1, p2, p3, p4)
	print(p)
	best = []
	if p1 == p:
		best = [xs - 1, ys]
	elif p2 == p:
		best = [xs + 1, ys]
	elif p3 == p:
		best = [xs, ys - 1]
	else:
		best = [xs, ys + 1]
	print(' '.join([str(x) for x in best]))

def __starting_point():
	main()
__starting_point()


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	(n, sx, sy) = sep()
	coor = {}
	for i in range(n):
		(a, b) = sep()
		a -= sx
		b -= sy
		coor[i] = [a, b]
	ans = 0
	cnt = 0
	for i in coor:
		if coor[i][0] >= 1:
			cnt += 1
	ans = max(ans, cnt)
	scor = [1, 0]
	cnt = 0
	for i in coor:
		if coor[i][0] <= -1:
			cnt += 1
	if cnt > ans:
		ans = cnt
		scor = [-1, 0]
	cnt = 0
	for i in coor:
		if coor[i][1] >= 1:
			cnt += 1
	if cnt > ans:
		ans = cnt
		scor = [0, 1]
	cnt = 0
	for i in coor:
		if coor[i][1] <= -1:
			cnt += 1
	if cnt > ans:
		ans = cnt
		scor = [0, -1]
	print(ans)
	print(scor[0] + sx, scor[1] + sy)
testcase(1)


INT_MAX = 10 ** 20 + 7
MOD = 10 ** 9 + 7
from sys import stdin, stdout

def INPUT():
	return list((int(i) for i in stdin.readline().split()))
import math

def inp():
	return stdin.readline()

def out(x):
	return stdout.write(x)
(n, sx, sy) = INPUT()
xp = 0
xn = 0
yp = 0
yn = 0
first = 0
second = 0
third = 0
fourth = 0
for i in range(n):
	(x, y) = INPUT()
	if y == sy:
		if x > sx:
			xp += 1
		else:
			xn += 1
	elif x == sx:
		if y > sy:
			yp += 1
		else:
			yn += 1
	elif x > sx and y < sy:
		fourth += 1
	elif x > sx and y > sy:
		first += 1
	elif x < sx and y > sy:
		second += 1
	else:
		third += 1
A = []
A.append(fourth + first + xp)
A.append(second + third + xn)
A.append(second + first + yp)
A.append(third + fourth + yn)
i = A.index(max(A))
print(A[i])
if i == 0:
	print(sx + 1, sy)
elif i == 1:
	print(sx - 1, sy)
elif i == 2:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


import sys
from collections import deque
ints = deque((int(x) for x in sys.stdin.read().split()))

def main():
	(n, x0, y0) = (ints.popleft() for i in range(3))
	xy = [(ints.popleft(), ints.popleft()) for i in range(n)]
	locs = [(0, 1), (0, -1), (1, 0), (-1, 0)]
	between = lambda x0, x, dx: x > x0 and dx >= 0 or (x < x0 and dx <= 0) or (x == x0 and dx == 0)
	num = {(x0 + dx, y0 + dy): sum((between(x0, x, dx) and between(y0, y, dy) for (x, y) in xy)) for (dx, dy) in locs}
	ans = max(num, key=lambda k: num[k])
	print(num[ans])
	print(*ans)
	return
while ints:
	main()


from sys import stdin, stdout
import math
import heapq
import collections
input = stdin.readline

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
(n, sx, sy) = inputnums()
N = 0
S = 0
E = 0
W = 0
for i in range(n):
	(x, y) = inputnums()
	if y > sy:
		N += 1
	elif y < sy:
		S += 1
	if x > sx:
		E += 1
	elif x < sx:
		W += 1
mx = max([N, S, E, W])
print(mx)
if N == mx:
	print(sx, sy + 1)
elif S == mx:
	print(sx, sy - 1)
elif E == mx:
	print(sx + 1, sy)
else:
	print(sx - 1, sy)


import bisect
import os
import gc
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import deque
import heapq
import math
import statistics

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	s = set()
	for p in range(2, n + 1):
		if prime[p]:
			s.add(p)
	return s

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def invert(x):
	if x == '1':
		return '0'
	else:
		return '1'

def main():
	(n, sx, sy) = ain()
	d = deque([])
	x = {'r': 0, 'l': 0, 'u': 0, 'd': 0}
	for _ in range(n):
		(ax, ay) = ain()
		if ax > sx:
			x['r'] += 1
		elif ax < sx:
			x['l'] += 1
		if ay > sy:
			x['u'] += 1
		elif ay < sy:
			x['d'] += 1
	maxi = 0
	side = ''
	for (key, val) in x.items():
		if val > maxi:
			maxi = val
			side = key
	print(maxi)
	if side == 'l':
		print(sx - 1, sy)
	elif side == 'r':
		print(sx + 1, sy)
	elif side == 'u':
		print(sx, sy + 1)
	else:
		print(sx, sy - 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(1):
	(n, sx, sy) = map(int, input().split())
	arr = []
	xless = 0
	yless = 0
	xmore = 0
	ymore = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		if a < sx:
			xless += 1
		elif a > sx:
			xmore += 1
		if b < sy:
			yless += 1
		elif b > sy:
			ymore += 1
	mx = max(xless, xmore, yless, ymore)
	print(mx)
	if mx == xless:
		print(sx - 1, sy)
	elif mx == xmore:
		print(sx + 1, sy)
	elif mx == ymore:
		print(sx, sy + 1)
	else:
		print(sx, sy - 1)


(n, sx, sy) = map(int, input().split())
(left, right, up, down) = (0, 0, 0, 0)
if sx > 0 and sy > 0:
	for i in range(n):
		(xi, yi) = map(int, input().split())
		if xi < sx and yi < sy:
			left += 1
			down += 1
		elif xi < sx and yi > sy:
			left += 1
			up += 1
		elif xi > sx and yi > sy:
			right += 1
			up += 1
		elif xi > sx and yi < sy:
			right += 1
			down += 1
		elif xi < sx and yi == sy:
			left += 1
		elif xi > sx and yi == sy:
			right += 1
		elif xi == sx and yi > sy:
			up += 1
		elif xi == sx and yi < sy:
			down += 1
	ans = max(left, right, up, down)
	print(ans)
	if ans == left:
		print(sx - 1, sy)
	elif ans == right:
		print(sx + 1, sy)
	elif ans == up:
		print(sx, sy + 1)
	elif ans == down:
		print(sx, sy - 1)
elif sx == 0 and sy > 0:
	for i in range(n):
		(xi, yi) = map(int, input().split())
		if xi > sx and yi > sy:
			right += 1
			up += 1
		elif xi > sx and yi < sy:
			right += 1
			down += 1
		elif xi > sx and yi == sy:
			right += 1
		elif xi == sx and yi > sy:
			up += 1
		elif xi == sx and yi < sy:
			down += 1
	ans = max(right, up, down)
	print(ans)
	if ans == right:
		print(sx + 1, sy)
	elif ans == up:
		print(sx, sy + 1)
	elif ans == down:
		print(sx, sy - 1)
elif sx > 0 and sy == 0:
	for i in range(n):
		(xi, yi) = map(int, input().split())
		if xi > sx and yi > sy:
			right += 1
			up += 1
		elif xi < sx and yi > sy:
			left += 1
			up += 1
		elif xi < sx and yi == sy:
			left += 1
		elif xi > sx and y == sy:
			right += 1
		elif xi == sx and yi > sy:
			up += 1
	ans = max(left, right, up)
	print(ans)
	if ans == right:
		print(sx + 1, sy)
	elif ans == up:
		print(sx, sy + 1)
	elif ans == left:
		print(sx - 1, sy)
elif sx == 0 and sy == 0:
	for i in range(n):
		(xi, yi) = map(int, input().split())
		if xi > sx and yi > sy:
			right += 1
			up += 1
		elif xi == sx and yi > sy:
			up += 1
		elif xi > sx and y == sy:
			right += 1
	ans = max(right, up)
	print(ans)
	if ans == right:
		print(sx + 1, sy)
	elif ans == up:
		print(sx, sy + 1)


import math
ar = []
studX = []
studY = []
for x in input().split(' '):
	ar.append(int(x))
up = 0
down = 0
right = 0
left = 0
for x in range(ar[0]):
	temp = []
	for y in input().split(' '):
		temp.append(int(y))
	if ar[1] == temp[0]:
		if ar[2] > temp[1]:
			left = left + 1
		else:
			right = right + 1
	elif ar[2] == temp[1]:
		if ar[1] > temp[0]:
			up = up + 1
		else:
			down = down + 1
	elif temp[0] > ar[1] and temp[1] > ar[2]:
		down = down + 1
		right = right + 1
	elif temp[0] < ar[1] and temp[1] < ar[2]:
		up = up + 1
		left = left + 1
	elif temp[0] > ar[1] and temp[1] < ar[2]:
		down = down + 1
		left = left + 1
	elif temp[0] < ar[1] and temp[1] > ar[2]:
		up = up + 1
		right = right + 1
temp = max(up, down, left, right)
if temp == up:
	print(up)
	print(ar[1] - 1, ar[2])
elif temp == down:
	print(down)
	print(ar[1] + 1, ar[2])
elif temp == left:
	print(left)
	print(ar[1], ar[2] - 1)
elif temp == right:
	print(right)
	print(ar[1], ar[2] + 1)


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()
(n, sx, sy) = getVars()
res = [0] * 4
for i in range(n):
	(x, y) = getVars()
	if x > sx:
		res[2] += 1
	if x < sx:
		res[0] += 1
	if y > sy:
		res[1] += 1
	if y < sy:
		res[3] += 1
m = max(res)
print(m)
if m == res[0]:
	print(sx - 1, sy)
elif m == res[1]:
	print(sx, sy + 1)
elif m == res[2]:
	print(sx + 1, sy)
elif m == res[3]:
	print(sx, sy - 1)


from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
(n, x, y) = iia()
count = [0 for i in range(4)]
ans = [(x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)]
for i in range(n):
	(a, b) = iia()
	if a > x:
		count[0] += 1
	if a < x:
		count[1] += 1
	if b > y:
		count[2] += 1
	if b < y:
		count[3] += 1
print(max(count))
print(*ans[count.index(max(count))])


(n, a, b) = [int(i) for i in input().split()]
(r, l, u, d) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = [int(i) for i in input().split()]
	if x > a:
		r += 1
	elif x < a:
		l += 1
	if y > b:
		u += 1
	elif y < b:
		d += 1
z = max(r, l, u, d)
print(z)
if r == z:
	print(a + 1, b)
elif l == z:
	print(a - 1, b)
elif u == z:
	print(a, b + 1)
else:
	print(a, b - 1)


(n, sx, sy) = list(map(int, input().split()))
res = [0, 0, 0, 0]
for _ in range(n):
	(x, y) = list(map(int, input().split()))
	if y > sy:
		res[0] += 1
	if x > sx:
		res[1] += 1
	if y < sy:
		res[2] += 1
	if x < sx:
		res[3] += 1
t = max(res)
print(t)
if t == res[0]:
	print(sx, sy + 1)
elif t == res[1]:
	print(sx + 1, sy)
elif t == res[2]:
	print(sx, sy - 1)
elif t == res[3]:
	print(sx - 1, sy)


(n, x, y) = map(int, input().split())
mp = {}
if x - 1 >= 0:
	mp[x - 1, y] = 0
if y - 1 >= 0:
	mp[x, y - 1] = 0
mp[x + 1, y] = 0
mp[x, y + 1] = 0
ma = 0
for _ in range(n):
	(u, v) = map(int, input().split())
	if u < x:
		if (x - 1, y) in mp:
			mp[x - 1, y] += 1
			ma = max(ma, mp[x - 1, y])
	if u > x:
		mp[x + 1, y] += 1
		ma = max(ma, mp[x + 1, y])
	if v > y:
		mp[x, y + 1] += 1
		ma = max(mp[x, y + 1], ma)
	if v < y:
		if (x, y - 1) in mp:
			mp[x, y - 1] += 1
			ma = max(ma, mp[x, y - 1])
print(ma)
if ma == mp[x, y + 1]:
	print(x, y + 1)
elif ma == mp[x + 1, y]:
	print(x + 1, y)
elif (x - 1, y) in mp and ma == mp[x - 1, y]:
	print(x - 1, y)
else:
	print(x, y - 1)


(k, sx, sy) = map(int, input().split())
coords = []
ne = []
nw = []
se = []
sw = []
n = []
e = []
s = []
w = []
nn = 0
ss = 0
ee = 0
ww = 0
for i in range(k):
	(a, b) = map(int, input().split())
	if a > sx:
		if b > sy:
			ne.append([a, b])
			nn += 1
			ee += 1
		elif b < sy:
			se.append([a, b])
			ss += 1
			ee += 1
		else:
			e.append([a, b])
			ee += 1
	elif a < sx:
		if b > sy:
			nw.append([a, b])
			nn += 1
			ww += 1
		elif b < sy:
			sw.append([a, b])
			ss += 1
			ww += 1
		else:
			w.append(a, b)
			ww += 1
	elif b > sy:
		n.append([a, b])
		nn += 1
	else:
		s.append([a, b])
		ss += 1
if nn >= ss and nn >= ee and (nn >= ww):
	print(nn)
	print(sx, sy + 1)
	exit()
if ss >= nn and ss >= ee and (ss >= ww):
	print(ss)
	print(sx, sy - 1)
	exit()
if ee >= ss and ee >= nn and (ee >= ww):
	print(ee)
	print(sx + 1, sy)
	exit()
if ww >= ss and ww >= ee and (ww >= nn):
	print(ww)
	print(sx - 1, sy)
	exit()


import sys
input = sys.stdin.readline
(N, sx, sy) = map(int, input().split())
A = [[0, 0], [0, 0]]
B = [[0, 0], [0, 0]]
for _ in range(N):
	(x, y) = map(int, input().split())
	if x == sx:
		if y > sy:
			B[0][0] += 1
		else:
			B[0][1] += 1
	elif y == sy:
		if x > sx:
			B[1][0] += 1
		else:
			B[1][1] += 1
	elif x > sx and y > sy:
		A[0][0] += 1
	elif x > sx and y < sy:
		A[0][1] += 1
	elif x < sx and y > sy:
		A[1][0] += 1
	else:
		A[1][1] += 1
P = [(A[0][0] + A[0][1] + B[1][0], sx + 1, sy), (A[0][0] + A[1][0] + B[0][0], sx, sy + 1), (A[0][1] + A[1][1] + B[0][1], sx, sy - 1), (A[1][0] + A[1][1] + B[1][0], sx - 1, sy)]
P.sort(reverse=True)
print(P[0][0])
print(P[0][1], P[0][2])


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
(n, sx, sy) = [int(s) for s in input().split()]
ar = [0, 0, 0, 0]
for _ in range(n):
	(x, y) = [int(s) for s in input().split()]
	for (i, cond) in enumerate((x < sx, x > sx, y < sy, y > sy)):
		ar[i] += 1 if cond else 0
i = max(range(4), key=lambda i: ar[i])
print(ar[i])
print(*[(sx - 1, sy), (sx + 1, sy), (sx, sy - 1), (sx, sy + 1)][i])


import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict

def main():
	(n, sx, sy) = map(int, input().split(' '))
	cnt1 = 0
	cnt2 = 0
	cnt3 = 0
	cnt4 = 0
	cnt5 = 0
	cnt6 = 0
	cnt7 = 0
	cnt8 = 0
	for x in range(n):
		(a, b) = map(int, input().split(' '))
		if a > sx and b > sy:
			cnt1 += 1
		if a < sx and b > sy:
			cnt2 += 1
		if a < sx and b < sy:
			cnt3 += 1
		if a > sx and b < sy:
			cnt4 += 1
		if a == sx and b > sy:
			cnt5 += 1
		if a == sx and b < sy:
			cnt6 += 1
		if b == sy and a > sx:
			cnt7 += 1
		if b == sy and a < sx:
			cnt8 += 1
	if max(cnt1 + cnt2 + cnt5, cnt3 + cnt4 + cnt6, cnt2 + cnt3 + cnt8, cnt1 + cnt4 + cnt7) == cnt1 + cnt2 + cnt5:
		print(cnt1 + cnt2 + cnt5)
		print(sx, sy + 1)
	elif max(cnt1 + cnt2 + cnt5, cnt3 + cnt4 + cnt6, cnt2 + cnt3 + cnt8, cnt1 + cnt4 + cnt7) == cnt3 + cnt4 + cnt6:
		print(cnt3 + cnt4 + cnt6)
		print(sx, sy - 1)
	elif max(cnt1 + cnt2 + cnt5, cnt3 + cnt4 + cnt6, cnt2 + cnt3 + cnt8, cnt1 + cnt4 + cnt7) == cnt2 + cnt3 + cnt8:
		print(cnt2 + cnt3 + cnt8)
		print(sx - 1, sy)
	elif max(cnt1 + cnt2 + cnt5, cnt3 + cnt4 + cnt6, cnt2 + cnt3 + cnt8, cnt1 + cnt4 + cnt7) == cnt1 + cnt4 + cnt7:
		print(cnt1 + cnt4 + cnt7)
		print(sx + 1, sy)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


inp = input
(n, sx, sy) = map(int, inp().strip().split(' '))
pts = []
for _ in range(n):
	(a, b) = map(int, inp().split(' '))
	pts.append((a, b))
top = (sx, sy + 1)
tpc = 0
for p in pts:
	if p[1] > sy:
		tpc += 1
bot = (sx, sy - 1)
bpc = 0
for p in pts:
	if p[1] < sy:
		bpc += 1
lef = (sx + 1, sy)
lpc = 0
for p in pts:
	if p[0] > sx:
		lpc += 1
rit = (sx - 1, sy)
rpc = 0
for p in pts:
	if p[0] < sx:
		rpc += 1
apt = [(tpc, top), (bpc, bot), (lpc, lef), (rpc, rit)]
apt.sort()
ans = apt[-1]
print(ans[0])
print(*ans[1])


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	(n, sx, sy) = rl()
	U = 0
	UR = 0
	R = 0
	DR = 0
	D = 0
	DL = 0
	L = 0
	UL = 0
	for i in range(n):
		(x, y) = rl()
		if x == sx and y > sy:
			U += 1
		elif x == sx and y < sy:
			D += 1
		elif x > sx and y == sy:
			R += 1
		elif x < sx and y == sy:
			L += 1
		elif x > sx and y > sy:
			U += 1
			R += 1
			UR += 1
		elif x > sx and y < sy:
			R += 1
			D += 1
			DR += 1
		elif x < sx and y < sy:
			D += 1
			L += 1
			DL += 1
		else:
			U += 1
			L += 1
			UL += 1
	m = max(U, L, D, R, UR, UL, DR, DL)
	print(m)
	if U == m:
		print(sx, sy + 1)
	elif UR == m:
		print(sx + 1, sy + 1)
	elif R == m:
		print(sx + 1, sy)
	elif DR == m:
		print(sx + 1, sy - 1)
	elif D == m:
		print(sx, sy - 1)
	elif DL == m:
		print(sx - 1, sy - 1)
	elif L == m:
		print(sx - 1, sy)
	elif UL == m:
		print(sx - 1, sy + 1)
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


from sys import stdin, stdout
from collections import deque
input = stdin.readline
asdf = [int(x) for x in input().split(' ')]
n = asdf[0]
skoolx = asdf[1]
skooly = asdf[2]
l = 0
r = 0
u = 0
d = 0
for i in range(n):
	li = [int(x) for x in input().split(' ')]
	if li[0] < skoolx:
		l += 1
	elif li[0] > skoolx:
		r += 1
	if li[1] < skooly:
		d += 1
	elif li[1] > skooly:
		u += 1
best = max([l, r, u, d])
if best == l:
	print(str(l) + '\n' + str(skoolx - 1) + ' ' + str(skooly))
elif best == r:
	print(str(r) + '\n' + str(skoolx + 1) + ' ' + str(skooly))
elif best == u:
	print(str(u) + '\n' + str(skoolx) + ' ' + str(skooly + 1))
else:
	print(str(d) + '\n' + str(skoolx) + ' ' + str(skooly - 1))


import os
import sys

def main():
	(N, X, Y) = read_ints()
	P = [tuple(read_ints()) for _ in range(N)]
	(c, x, y) = solve(N, X, Y, P)
	print(c)
	print(x, y)
PX = 0
MX = 1
PY = 2
MY = 3

def ok(x, y):
	return 0 <= x <= 10 ** 9 and 0 <= y <= 10 ** 9

def solve(N, X, Y, P):
	counts = [0] * 4
	coords = [(X + 1, Y), (X - 1, Y), (X, Y + 1), (X, Y - 1)]
	for (x, y) in P:
		if x > X:
			counts[PX] += 1
		if x < X:
			counts[MX] += 1
		if y > Y:
			counts[PY] += 1
		if y < Y:
			counts[MY] += 1
	mc = max(counts)
	for i in range(4):
		if counts[i] == mc and ok(*coords[i]):
			return (mc, coords[i][0], coords[i][1])
	assert False
DEBUG = 'DEBUG' in os.environ

def inp():
	return sys.stdin.readline().rstrip()

def read_int():
	return int(inp())

def read_ints():
	return [int(e) for e in inp().split()]

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)
main()


(n, sx, sy) = map(int, input().split())
(l, r, a, b, e) = (0, 0, 0, 0, 0)
for _ in range(0, n):
	(aa, bb) = map(int, input().split())
	if aa < sx:
		l += 1
	if aa > sx:
		r += 1
	if bb > sy:
		a += 1
	if bb < sy:
		b += 1
qq = max(r, l, a, b)
if qq == r:
	print(r)
	print(sx + 1, sy)
elif qq == l:
	print(l)
	print(max(0, sx - 1), sy)
elif qq == a:
	print(a)
	print(sx, sy + 1)
else:
	print(b)
	print(sx, max(0, sy - 1))


from sys import stdin
input = lambda : stdin.readline().rstrip('\r\n')
input_a = lambda fun: map(fun, stdin.readline().split())
(n, x, y) = map(int, input().split())
(c1, c2, c3, c4) = (0, 0, 0, 0)
for i in range(n):
	(xi, yi) = input_a(int)
	dx = xi - x
	dy = yi - y
	if dx > 0:
		c1 += 1
	if dy > 0:
		c2 += 1
	if dx < 0:
		c3 += 1
	if dy < 0:
		c4 += 1
c = max(c1, c2, c3, c4)
print(c)
if c1 == c:
	print(x + 1, y)
elif c2 == c:
	print(x, y + 1)
elif c3 == c:
	print(x - 1, y)
elif c4 == c:
	print(x, y - 1)


(n, sx, sy) = [int(i) for i in input().split()]
(q1, q2, q3, q4, a1, a2, a3, a4) = (0, 0, 0, 0, 0, 0, 0, 0)
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	if x > sx:
		if y > sy:
			q1 += 1
		elif y == sy:
			a1 += 1
		else:
			q4 += 1
	elif x < sx:
		if y > sy:
			q2 += 1
		elif y == sy:
			a3 += 1
		else:
			q3 += 1
	elif y > sy:
		a2 += 1
	else:
		a4 += 1
quad = [q1 + q4 + a1, q1 + q2 + a2, q2 + q3 + a3, q3 + q4 + a4]
print(max(quad))
ind = quad.index(max(quad))
if ind == 0:
	print(sx + 1, sy)
elif ind == 1:
	print(sx, sy + 1)
elif ind == 2:
	print(sx - 1, sy)
else:
	print(sx, sy - 1)


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'
(n, x, y) = map(int, input().split())
st = []
for i in range(n):
	(a, b) = map(int, input().split())
	st.append((a, b))
ans = 0
corx = 0
an = 0
co = 0
for i in range(n):
	if st[i][0] < x:
		an += 1
		co = max(co, st[i][0])
if an > ans:
	ans = an
	corx = co
an = 0
co = 10 ** 9
for i in range(n):
	if st[i][0] > x:
		an += 1
		co = min(co, st[i][0])
if an > ans:
	ans = an
	corx = co
ans1 = 0
cory = 0
an = 0
co = 10 ** 9
for i in range(n):
	if st[i][1] > y:
		an += 1
		co = min(co, st[i][1])
if an > ans1:
	ans1 = an
	cory = co
an = 0
co = 0
for i in range(n):
	if st[i][1] < y:
		an += 1
		co = max(co, st[i][1])
if an > ans1:
	ans1 = an
	cory = co
if ans > ans1:
	print(ans)
	print(corx, y)
else:
	print(ans1)
	print(x, cory)


import sys
(n, sx, sy) = map(int, input().split())
c1 = 0
c12 = 0
c2 = 0
c23 = 0
c3 = 0
c34 = 0
c4 = 0
c41 = 0
a12 = 0
a23 = 0
a34 = 0
a41 = 0
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().split())
	if x > sx:
		if y > sy:
			c1 += 1
		elif y < sy:
			c4 += 1
		else:
			c41 += 1
	elif x < sx:
		if y > sy:
			c2 += 1
		elif y < sy:
			c3 += 1
		else:
			c23 += 1
	elif y < sy:
		c34 += 1
	else:
		c12 += 1
a12 = c1 + c12 + c2
a23 = c2 + c23 + c3
a34 = c3 + c34 + c4
a41 = c4 + c41 + c1
answer = max(a12, a23, a34, a41)
if a12 == answer:
	print(answer)
	print(sx, sy + 1)
elif a23 == answer:
	print(answer)
	print(sx - 1, sy)
elif a34 == answer:
	print(answer)
	print(sx, sy - 1)
elif a41 == answer:
	print(answer)
	print(sx + 1, sy)


import sys
input = sys.stdin.readline
(n, a, b) = map(int, input().split())
up = down = left = right = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if p > a:
		right += 1
	if p < a:
		left += 1
	if q > b:
		up += 1
	if q < b:
		down += 1
MAX = max(up, down, right, left)
print(MAX)
if MAX == up:
	print(a, b + 1)
elif MAX == down:
	print(a, b - 1)
elif MAX == right:
	print(a + 1, b)
elif MAX == left:
	print(a - 1, b)


import sys
input = sys.stdin.readline
(n, x, y) = map(int, input().split())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	l.append((a, b))
(c1, c2, c3, c4) = (0, 0, 0, 0)
(l1, l2, l3, l4) = ((x, y + 1), (x + 1, y), (x, y - 1), (x - 1, y))
d = {}
for i in range(n):
	if l[i][1] >= l1[1]:
		c1 += 1
	if l[i][0] >= l2[0]:
		c2 += 1
	if l[i][1] <= l3[1]:
		c3 += 1
	if l[i][0] <= l4[0]:
		c4 += 1
d[l1] = c1
d[l2] = c2
d[l3] = c3
d[l4] = c4
ans = max(c1, c2, c3, c4)
print(ans)
for i in d:
	if d[i] == ans:
		print(i[0], end=' ')
		print(i[1])
		exit()


def solve(n, schX, schY, houses):
	up = 0
	down = 0
	left = 0
	right = 0
	for (x, y) in houses:
		if x > schX:
			right += 1
		elif x < schX:
			left += 1
		if y > schY:
			up += 1
		elif y < schY:
			down += 1
	if up >= down and up >= left and (up >= right):
		print(up)
		print(schX, schY + 1)
	elif down >= up and down >= left and (down >= right):
		print(down)
		print(schX, schY - 1)
	elif left >= up and left >= down and (left >= right):
		print(left)
		print(schX - 1, schY)
	else:
		print(right)
		print(schX + 1, schY)
(times, schX, schY) = list(map(int, input().split()))
loc = []
for _ in range(times):
	loc.append(list(map(int, input().split())))
solve(times, schX, schY, loc)


import sys
input = sys.stdin.readline
(N, Sx, Sy) = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]
around = [(0, 1), (1, 0), (0, -1), (-1, 0)]
pxpy = [(Sx + dx, Sy + dy) for (dx, dy) in around]
cand = [0] * 4
for (x, y) in XY:
	k = abs(x - Sx) + abs(y - Sy)
	for (t, (px, py)) in enumerate(pxpy):
		i = abs(px - Sx) + abs(py - Sy)
		j = abs(x - px) + abs(y - py)
		if i + j == k:
			cand[t] += 1
c = max(cand)
(px, py) = pxpy[cand.index(c)]
print(c)
print(px, py)


import sys

def main():
	input = sys.stdin.read()
	data = list(map(int, input.split()))
	(n, x, y) = data[0:3]
	idx = [0] * 5
	for i in range(3, len(data), 2):
		if data[i] > x:
			idx[1] += 1
		elif data[i] < x:
			idx[2] += 1
		if data[i + 1] > y:
			idx[3] += 1
		elif data[i + 1] < y:
			idx[4] += 1
	nt = 0
	ans = 0
	for i in range(1, 5):
		if idx[i] > ans:
			ans = idx[i]
			nt = i
	print(ans)
	if nt == 1:
		print(str(x + 1) + ' ' + str(y))
	elif nt == 2:
		print(str(x - 1) + ' ' + str(y))
	elif nt == 3:
		print(str(x) + ' ' + str(y + 1))
	else:
		print(str(x) + ' ' + str(y - 1))
main()


(n, sx, sy) = map(int, input().split())
md = [0, 0, 0, 0]
ax = [0, 0, 0, 0]
for i in range(n):
	(x, y) = map(int, input().split())
	if x == sx:
		ax[2 + int(sy < y)] += 1
	elif y == sy:
		ax[int(sx < x)] += 1
	else:
		md[int(y < sy) + int(x < sx) * 2] += 1
l = [md[0] + md[1] + ax[1], md[0] + md[2] + ax[3], md[3] + md[2] + ax[0], md[3] + md[1] + ax[2]]
d = [[1, 0], [0, 1], [-1, 0], [0, -1]]
k = l.index(max(l))
print(max(l))
print(sx + d[k][0], sy + d[k][1])


(n, sx, sy) = list(map(int, input().split()))
(xl, xg, yl, yg) = (0, 0, 0, 0)
for j in range(n):
	(x, y) = list(map(int, input().split()))
	if x < sx:
		xl += 1
	elif x > sx:
		xg += 1
	if y < sy:
		yl += 1
	elif y > sy:
		yg += 1
mxm = max(xl, yl, xg, yg)
if mxm == yl:
	sy -= 1
elif mxm == yg:
	sy += 1
elif mxm == xl:
	sx -= 1
else:
	sx += 1
print(mxm)
print(sx, sy)


(n, s_x, s_y) = map(int, input().split())
(S, E, W, N) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	if y > s_y:
		N += 1
	elif y < s_y:
		S += 1
	if x > s_x:
		E += 1
	elif x < s_x:
		W += 1
if S == max(S, E, W, N):
	print(S)
	print(s_x, s_y - 1)
elif E == max(S, E, W, N):
	print(E)
	print(s_x + 1, s_y)
elif W == max(S, E, W, N):
	print(W)
	print(s_x - 1, s_y)
elif N == max(S, E, W, N):
	print(N)
	print(s_x, s_y + 1)


(n, a, b) = [int(j) for j in input().split()]
up = down = left = right = 0
for i in range(n):
	(p, q) = [int(j) for j in input().split()]
	if p > a:
		right += 1
	if p < a:
		left += 1
	if q > b:
		up += 1
	if q < b:
		down += 1
m = max(up, down, right, left)
print(m)
if m == up:
	print(a, b + 1)
elif m == down:
	print(a, b - 1)
elif m == right:
	print(a + 1, b)
elif m == left:
	print(a - 1, b)


(n, a, b) = map(int, input().split())
countyp = 0
countyn = 0
countxp = 0
countxn = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if y > b and x > a:
		countxp += 1
		countyp += 1
	elif y > b and x == a:
		countyp += 1
	elif y == b and x > a:
		countxp += 1
	elif x > a and y < b:
		countyn += 1
		countxp += 1
	elif y < b and x == a:
		countyn += 1
	elif x < a and y < b:
		countxn += 1
		countyn += 1
	elif x < a and y == b:
		countxn += 1
	elif x < a and y > b:
		countyp += 1
		countxn += 1
min1 = countyn
min2 = countxn
if countyp > countyn:
	min1 = countyp
if countxp > min2:
	min2 = countxp
mini = min2
if min1 > min2:
	mini = min1
print(mini)
if mini == countxn:
	print(a - 1, b)
elif mini == countxp:
	print(a + 1, b)
elif mini == countyn:
	print(a, b - 1)
else:
	print(a, b + 1)


import bisect
(n, sx, sy) = [int(i) for i in input().split()]
arrx = []
arry = []
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	arrx.append(x)
	arry.append(y)
arrx.sort()
arry.sort()
ans1 = [n - bisect.bisect_left(arrx, sx + 1), sx + 1, sy]
ans2 = [n - bisect.bisect_left(arry, sy + 1), sx, sy + 1]
ans3 = [bisect.bisect_left(arrx, sx - 1), sx - 1, sy]
ans4 = [bisect.bisect_left(arry, sy - 1), sx, sy - 1]
print(max(ans1, ans2, ans3, ans4)[0])
print(str(max(ans1, ans2, ans3, ans4)[1]) + ' ' + str(max(ans1, ans2, ans3, ans4)[2]))


(n, sx, sy) = map(int, input().split())
(q1s, q2s, q3s, q4s) = (0, 0, 0, 0)
(q12s, q23s, q34s, q41s) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	if x == sx:
		if y > sy:
			q41s += 1
		else:
			q23s += 1
	elif y == sy:
		if x > sx:
			q12s += 1
		else:
			q34s += 1
	elif x > sx and y > sy:
		q1s += 1
	elif x > sx and y < sy:
		q2s += 1
	elif x < sx and y < sy:
		q3s += 1
	elif x < sx and y > sy:
		q4s += 1
ans = []
ans.append((q1s + q2s + q12s, (sx + 1, sy)))
ans.append((q2s + q3s + q23s, (sx, sy - 1)))
ans.append((q3s + q4s + q34s, (sx - 1, sy)))
ans.append((q4s + q1s + q41s, (sx, sy + 1)))
a = sorted(ans)[-1]
print(a[0])
print(a[1][0], a[1][1])


from sys import stdin, stdout
from bisect import bisect_right as br
from bisect import bisect_left as bl
from math import gcd
x = []
y = []
(n, sx, sy) = map(int, stdin.readline().split())
for i in range(n):
	(xi, yi) = map(int, stdin.readline().split())
	x += [xi]
	y += [yi]
x.sort()
y.sort()
a = br(x, sx - 1)
b = len(x) - bl(x, sx + 1)
c = br(y, sy - 1)
d = len(y) - bl(y, sy + 1)
ans = max(a, b, c, d)
if ans == a:
	ansx = sx - 1
	ansy = sy
if ans == b:
	ansx = sx + 1
	ansy = sy
if ans == c:
	ansx = sx
	ansy = sy - 1
if ans == d:
	ansx = sx
	ansy = sy + 1
stdout.write(str(ans) + '\n')
stdout.write(str(ansx) + ' ' + str(ansy))


def solve():
	(n, sx, sy) = [int(x) for x in input().split()]
	l = 0
	r = 0
	u = 0
	d = 0
	for p in range(n):
		(px, py) = [int(x) for x in input().split()]
		if py > sy:
			u += 1
		if py < sy:
			d += 1
		if px < sx:
			l += 1
		if px > sx:
			r += 1
	m = max(l, r, u, d)
	print(m)
	if l == m:
		print(sx - 1, sy)
		return
	if r == m:
		print(sx + 1, sy)
		return
	if u == m:
		print(sx, sy + 1)
		return
	if d == m:
		print(sx, sy - 1)
		return
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
solve()


import sys
input = sys.stdin.readline
(n, x, y) = map(int, input().split())
p = [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]
s = []
for _ in range(n):
	(a, b) = map(int, input().split())
	s.append([min(a, x), max(a, x), min(b, y), max(b, y)])
m = 0
q = -1
for i in range(4):
	(a, b) = p[i]
	c = 0
	for j in range(n):
		if s[j][0] <= a <= s[j][1] and s[j][2] <= b <= s[j][3]:
			c += 1
	if c > m:
		m = c
		q = i
print(m)
print(*p[q])


(n, sx, sy) = [int(i) for i in input().split(' ')]
z = [0, 0, 0, 0]
for i in range(n):
	(x, y) = input().split(' ')
	x = int(x)
	y = int(y)
	if y < sy:
		z[0] += 1
	if x < sx:
		z[1] += 1
	if y > sy:
		z[2] += 1
	if x > sx:
		z[3] += 1
numb = max(z)
pos = z.index(max(z))
print(numb)
if pos == 0:
	print(str(sx) + ' ' + str(sy - 1))
elif pos == 1:
	print(str(sx - 1) + ' ' + str(sy))
elif pos == 2:
	print(str(sx) + ' ' + str(sy + 1))
else:
	print(str(sx + 1) + ' ' + str(sy))


(n, sx, sy) = map(int, input().split())
left = 0
right = 0
up = 0
down = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		right = right + 1
	elif x < sx:
		left = left + 1
	if y > sy:
		up = up + 1
	elif y < sy:
		down = down + 1

def max(a, b, c, d):
	return a >= b and a >= c and (a >= d)
if max(left, right, up, down):
	sx -= 1
	stu = left
elif max(right, left, up, down):
	sx += 1
	stu = right
elif max(up, down, left, right):
	sy += 1
	stu = up
else:
	sy -= 1
	stu = down
print(stu, '\n', sx, ' ', sy, sep='')


import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def li2():
	return [i for i in input().rstrip('\n').split(' ')]
(n, s1, s2) = li()
l = []
for i in range(n):
	l.append(li())
(a1, a2, a3, a4) = [0] * 4
for i in range(n):
	if s1 == l[i][0]:
		if s2 < l[i][1]:
			a2 += 1
		else:
			a4 += 1
	elif s2 == l[i][1]:
		if s1 < l[i][0]:
			a3 += 1
		else:
			a1 += 1
	else:
		if s1 < l[i][0]:
			a3 += 1
		else:
			a1 += 1
		if s2 < l[i][1]:
			a2 += 1
		else:
			a4 += 1
ans = max(a1, a2, a3, a4)
print(ans)
if a1 == ans:
	print(s1 - 1, s2)
elif a3 == ans:
	print(s1 + 1, s2)
elif a2 == ans:
	print(s1, s2 + 1)
else:
	print(s1, s2 - 1)


(n, sx, sy) = map(int, input().split())
l = r = u = d = 0
import sys
input = sys.stdin.readline
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		r += 1
	if x < sx:
		l += 1
	if y > sy:
		u += 1
	if y < sy:
		d += 1
if u >= max(l, r, d) and sy < 10 ** 9:
	print(u)
	print(sx, sy + 1)
elif d >= max(l, r) and sy > 0:
	print(d)
	print(sx, sy - 1)
elif l >= r and sx >= 0:
	print(l)
	print(sx - 1, sy)
elif sx < 10 ** 9:
	print(r)
	print(sx + 1, sy)


(up, down, left, right) = (0, 0, 0, 0)
(n, sX, sY) = tuple(map(int, input().split()))
for i in range(n):
	loc = tuple(map(int, input().split()))
	if loc[0] < sX:
		left += 1
	elif loc[0] > sX:
		right += 1
	if loc[1] > sY:
		up += 1
	elif loc[1] < sY:
		down += 1
tent_loc = [sX, sY]
a = max(up, down, left, right)
if a == up:
	tent_loc[1] += 1
elif a == down:
	tent_loc[1] -= 1
elif a == left:
	tent_loc[0] -= 1
else:
	tent_loc[0] += 1
print(a)
print(tent_loc[0], tent_loc[1])


(n, x, y) = map(int, input().split())
(ax, ay) = ([], [])
(up, down, l, r) = [0] * 4
mx = 0
for i in range(n):
	(nx, ny) = map(int, input().split())
	if ny > y:
		up += 1
	if nx > x:
		r += 1
	if nx < x:
		l += 1
	if ny < y:
		down += 1
	mx = max(mx, down)
	mx = max(mx, up)
	mx = max(mx, l)
	mx = max(mx, r)
print(mx)
if mx == down:
	print(x, y - 1)
elif mx == up:
	print(x, y + 1)
elif mx == l:
	print(x - 1, y)
else:
	print(x + 1, y)


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
l = r = u = d = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		r += 1
	elif x < sx:
		l += 1
	if y > sy:
		u += 1
	elif y < sy:
		d += 1
q = max(r, l, d, u)
print(q)
if r == q:
	print(sx + 1, sy)
elif l == q:
	print(sx - 1, sy)
elif u == q:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


(n, sx, sy) = input().split()
(n, sx, sy) = (int(n), int(sx), int(sy))
(cl, cr, cu, cd) = (0, 0, 0, 0)
for i in range(n):
	(xi, yi) = input().split()
	(xi, yi) = (int(xi), int(yi))
	if xi < sx:
		cl += 1
	if xi > sx:
		cr += 1
	if yi < sy:
		cd += 1
	if yi > sy:
		cu += 1
mx = max([cl, cr, cu, cd])
print(mx)
if mx == cl:
	print(str(sx - 1) + ' ' + str(sy))
elif mx == cr:
	print(str(sx + 1) + ' ' + str(sy))
elif mx == cd:
	print(str(sx) + ' ' + str(sy - 1))
elif mx == cu:
	print(str(sx) + ' ' + str(sy + 1))


def zip_sorted(a, b):
	return (zip(*sorted(zip(a, b)))[0], zip(*sorted(zip(a, b)))[1])

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def ncr(n, r):
	return math.comb(n, r)

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def decimal_to_binary(n):
	return bin(n).replace('0b', '')

def binary_to_decimal(s):
	return int(s, 2)
import sys, os.path
import math
from collections import defaultdict, deque
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
S = lambda : list(map(str, input1()))

def main():
	(n, sx, sy) = I()
	x_1 = []
	y_1 = []
	x_2 = []
	y_2 = []
	x_3 = []
	y_3 = []
	x_4 = []
	y_4 = []
	y_p = []
	y_n = []
	x_p = []
	x_n = []
	for i in range(n):
		(xi, yi) = I()
		if xi == sx:
			if yi - sy > 0:
				y_p.append(yi)
			else:
				y_n.append(yi)
		if yi == sy:
			if xi - sx > 0:
				x_p.append(xi)
			else:
				x_n.append(xi)
		if xi - sx > 0:
			if yi - sy > 0:
				x_1.append(xi)
				y_1.append(yi)
			elif yi - sy < 0:
				x_4.append(xi)
				y_4.append(yi)
		elif xi - sx < 0:
			if yi - sy > 0:
				x_2.append(xi)
				y_2.append(yi)
			elif yi - sy < 0:
				x_3.append(xi)
				y_3.append(yi)
	x_1 = x_1 + x_4 + x_p
	x_2 = x_2 + x_3 + x_n
	y_1 = y_1 + y_2 + y_p
	y_3 = y_3 + y_4 + y_n
	x_1 = sorted(x_1)
	x_2 = sorted(x_2)
	y_1 = sorted(y_1)
	y_2 = sorted(y_3)
	if len(x_1) == max(len(x_1), len(x_2), len(y_1), len(y_2)):
		print(len(x_1))
		print(sx + 1, sy)
	elif len(x_2) == max(len(x_1), len(x_2), len(y_1), len(y_2)):
		print(len(x_2))
		print(sx - 1, sy)
	elif len(y_1) == max(len(x_1), len(x_2), len(y_1), len(y_2)):
		print(len(y_1))
		print(sx, sy + 1)
	elif len(y_2) == max(len(x_1), len(x_2), len(y_1), len(y_2)):
		print(len(y_2))
		print(sx, sy - 1)
main()


(n, x, y) = map(int, input().split())
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(p, q) = map(int, input().split())
	if p > x:
		a += 1
	if p < x:
		b += 1
	if q > y:
		c += 1
	if q < y:
		d += 1
ans = max(a, b, c, d)
print(ans)
if d == ans:
	print(x, y - 1)
elif a == ans:
	print(x + 1, y)
elif c == ans:
	print(x, y + 1)
elif b == ans:
	print(x - 1, y)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(n, sx, sy) = tuple(map(int, input().split()))
t1 = 0
t2 = 0
t3 = 0
t4 = 0
for i in range(n):
	(x, y) = tuple(map(int, input().split()))
	if y > sy:
		t1 += 1
	elif y < sy:
		t2 += 1
	if x > sx:
		t3 += 1
	elif x < sx:
		t4 += 1
t = max(t1, t2, t3, t4)
print(t)
if t == t1:
	print(sx, sy + 1)
elif t == t2:
	print(sx, sy - 1)
elif t == t3:
	print(sx + 1, sy)
else:
	print(sx - 1, sy)


from sys import stdin

def input():
	return next(stdin)
(n, x, y) = map(int, input().split())
l = []
num = [0] * 4
for i in range(n):
	(a, b) = map(int, input().split())
	if a < x:
		num[0] += 1
	elif a > x:
		num[2] += 1
	if b > y:
		num[3] += 1
	elif b < y:
		num[1] += 1
m = 0
mi = 0
for i in range(4):
	if num[i] > m:
		m = num[i]
		mi = i
print(m)
if mi == 0:
	print(x - 1, y)
elif mi == 3:
	print(x, y + 1)
elif mi == 2:
	print(x + 1, y)
else:
	print(x, y - 1)


(n, sx, sy) = map(int, input().split())
coor = []
up = 0
down = 0
left = 0
right = 0
for _ in range(n):
	(x, y) = map(int, input().split())
	if x == sx:
		if y > sy:
			up += 1
		else:
			down += 1
	elif y == sy:
		if x > sx:
			right += 1
		else:
			left += 1
	else:
		c = (x, y)
		coor.append(c)
for coordinate in coor:
	if coordinate[1] > sy:
		up += 1
	elif coordinate[1] < sy:
		down += 1
for coordinate in coor:
	if coordinate[0] > sx:
		right += 1
	elif coordinate[0] < sx:
		left += 1
best = max(up, down, left, right)
if up == best:
	print(up)
	print(sx, sy + 1)
elif down == best:
	print(down)
	print(sx, sy - 1)
elif left == best:
	print(left)
	print(sx - 1, sy)
else:
	print(right)
	print(sx + 1, sy)


l = input().split()
n = int(l[0])
sx = int(l[1])
sy = int(l[2])
numofr = 0
numofl = 0
numofu = 0
numofd = 0
for i in range(n):
	l = input().split()
	x = int(l[0])
	y = int(l[1])
	if x > sx:
		numofr += 1
	if x < sx:
		numofl += 1
	if y > sy:
		numofu += 1
	if y < sy:
		numofd += 1
print(max(numofr, numofl, numofu, numofd))
if max(numofd, numofl, numofr, numofu) == numofd:
	print(sx, sy - 1)
elif max(numofd, numofl, numofr, numofu) == numofu:
	print(sx, sy + 1)
elif max(numofd, numofl, numofr, numofu) == numofl:
	print(sx - 1, sy)
elif max(numofd, numofl, numofr, numofu) == numofr:
	print(sx + 1, sy)


import sys
input = sys.stdin.readline
(n, sx, sy) = (int(x) for x in input().split())
east = 0
west = 0
south = 0
north = 0
for i in range(n):
	(x, y) = (int(x) for x in input().split())
	if x < sx:
		if y > sy:
			north += 1
			west += 1
		elif y < sy:
			south += 1
			west += 1
		else:
			west += 1
	elif x > sx:
		if y > sy:
			north += 1
			east += 1
		elif y < sy:
			south += 1
			east += 1
		else:
			east += 1
	elif y > sy:
		north += 1
	elif y < sy:
		south += 1
print(max([east, west, south, north]))
if east >= max([west, south, north]):
	print(sx + 1, sy)
elif west >= max([east, south, north]):
	print(sx - 1, sy)
elif south >= max([east, west, north]):
	print(sx, sy - 1)
else:
	print(sx, sy + 1)


a = list(map(int, input().split()))
a_x = a[1]
a_y = a[2]
up = []
down = []
plus = []
minus = []
ans = []
for i in range(a[0]):
	b = list(map(int, input().split()))
	if b[0] > a[1] and b[1] != a[2]:
		plus.append(b)
	elif b[0] < a[1] and b[1] != a[2]:
		minus.append(b)
	if b[1] > a[2] and b[0] != a[1]:
		up.append(b)
	elif b[1] < a[2] and b[0] != a[1]:
		down.append(b)
	if b[0] == a[1]:
		if b[1] > a[2]:
			up.append(b)
		else:
			down.append(b)
	if b[1] == a[2]:
		if b[0] > a[1]:
			plus.append(b)
		else:
			minus.append(b)
k = max(len(up), len(down), len(plus), len(minus))
if k == len(plus):
	print(len(plus))
	ans.append(a_x + 1)
	ans.append(a_y)
elif k == len(minus):
	print(len(minus))
	ans.append(a_x - 1)
	ans.append(a_y)
elif k == len(up):
	print(len(up))
	ans.append(a_x)
	ans.append(a_y + 1)
elif k == len(down):
	print(len(down))
	ans.append(a_x)
	ans.append(a_y - 1)
print(*ans)


from collections import defaultdict

def sign(x):
	if x == 0:
		return 0
	elif x < 0:
		return -1
	else:
		return 1
(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, 0)
max_key_len = -1
for key in [(1, 0), (-1, 0)]:
	x = key[0]
	if len(ht_pos[x, 1]) + len(ht_pos[x, -1]) + len(ht_pos[x, 0]) > max_key_len:
		max_key_len = len(ht_pos[x, 1]) + len(ht_pos[x, -1]) + len(ht_pos[x, 0])
		max_key = key
for key in [(0, 1), (0, -1)]:
	y = key[1]
	if len(ht_pos[1, y]) + len(ht_pos[-1, y]) + len(ht_pos[0, y]) > max_key_len:
		max_key_len = len(ht_pos[1, y]) + len(ht_pos[-1, y]) + len(ht_pos[0, y])
		max_key = key
if max_key in ((1, 0), (-1, 0)):
	x = max_key[0]
	if x == 1:
		x_min = float('inf')
		for y in (0, 1, -1):
			c = [xy[0] for xy in ht_pos[x, y]]
			c.append(x_min)
			x_min = min(c)
	else:
		x_min = float('-inf')
		for y in (0, 1, -1):
			c = [xy[0] for xy in ht_pos[x, y]]
			c.append(x_min)
			x_min = max(c)
	print(max_key_len)
	print(x_min, sy)
else:
	y = max_key[1]
	if y == 1:
		y_min = float('inf')
		for x in (0, 1, -1):
			c = [xy[1] for xy in ht_pos[x, y]]
			c.append(y_min)
			y_min = min(c)
	else:
		y_min = float('-inf')
		for x in (0, 1, -1):
			c = [xy[1] for xy in ht_pos[x, y]]
			c.append(y_min)
			y_min = max(c)
	print(max_key_len)
	print(sx, y_min)


(n, sx, sy) = map(int, input().split())
rsc = 0
lsc = 0
usc = 0
dsc = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		rsc += 1
		if y > sy:
			usc += 1
		elif y < sy:
			dsc += 1
	elif x < sx:
		lsc += 1
		if y > sy:
			usc += 1
		elif y < sy:
			dsc += 1
	elif x == sx:
		if y > sy:
			usc += 1
		elif y < sy:
			dsc += 1
kids = max(lsc, rsc, usc, dsc)
print(kids)
if lsc == kids:
	scordx = sx - 1
	scordy = sy
elif rsc == kids:
	scordx = sx + 1
	scordy = sy
elif usc == kids:
	scordx = sx
	scordy = sy + 1
elif dsc == kids:
	scordx = sx
	scordy = sy - 1
print(scordx, scordy)


import sys
import math
from collections import defaultdict, Counter, deque
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, sx, sy) = map(int, input().split())
d = [0] * 4
for i in range(n):
	(x, y) = map(int, input().split())
	if x == sx:
		if y > sy:
			d[0] += 1
		else:
			d[2] += 1
	elif y == sy:
		if x > sx:
			d[1] += 1
		else:
			d[3] += 1
	elif x > sx:
		if y > sy:
			d[0] += 1
			d[1] += 1
		else:
			d[1] += 1
			d[2] += 1
	elif y > sy:
		d[0] += 1
		d[3] += 1
	else:
		d[3] += 1
		d[2] += 1
ma = max(d)
print(ma)
for j in range(4):
	if d[j] == ma:
		if j == 0:
			print(sx, sy + 1)
		elif j == 1:
			print(sx + 1, sy)
		elif j == 2:
			print(sx, sy - 1)
		else:
			print(sx - 1, sy)
		break


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def num():
	return int(input())

def line():
	return map(int, input().split())
from itertools import repeat
from operator import itemgetter as ig

def sign(x):
	if x == 0:
		return 0
	if x > 0:
		return 1
	return -1
(n, *s) = line()
q = [0, 0, 0, 0]
for (x, y) in (line() for _ in repeat(None, n)):
	(x, y) = (x - s[0], y - s[1])
	if x > 0:
		q[0] += 1
	if x < 0:
		q[1] += 1
	if y > 0:
		q[2] += 1
	if y < 0:
		q[3] += 1
v = max(enumerate(q), key=ig(1))
print(v[1])
if v[0] == 0:
	print(s[0] + 1, s[1])
if v[0] == 1:
	print(s[0] - 1, s[1])
if v[0] == 2:
	print(s[0], s[1] + 1)
if v[0] == 3:
	print(s[0], s[1] - 1)


from copy import copy

def arr_float_inp():
	return [float(s) for s in input().split()]

def arr_int_inp():
	return [int(s) for s in input().split()]

def int_inp():
	return int(input())

def float_inp():
	return float(input())

def comp(a):
	return a[0]
(n, sh_x, sh_y) = arr_int_inp()
a = [arr_int_inp() for i in range(n)]
up = []
left = []
down = []
right = []
for i in range(n):
	x = a[i][0] - sh_x
	y = a[i][1] - sh_y
	if x > 0:
		right.append(a[i])
	elif x < 0:
		left.append(a[i])
	if y > 0:
		up.append(a[i])
	elif y < 0:
		down.append(a[i])
up = [len(up), [0, 1], up]
down = [len(down), [0, -1], down]
left = [len(left), [-1, 0], left]
right = [len(right), [1, 0], right]
out = sorted([up, down, left, right], key=comp)
print(out[-1][0])
sh_x += out[-1][1][0]
sh_y += out[-1][1][1]
print(sh_x, sh_y)


from sys import stdin, stdout
(n, h, k) = map(int, input().split())
o = [h, k]
a = []
for i in range(n):
	a.append(list(map(int, stdin.readline().split())))
maxi = 0
l = 0
r = 0
u = 0
d = 0
final = [0, 0]
for i in a:
	if i[0] <= o[0] - 1:
		l += 1
	if i[0] >= o[0] + 1:
		r += 1
	if i[1] >= o[1] + 1:
		u += 1
	if i[1] <= o[1] - 1:
		d += 1
maxi = max(r, l, u, d)
if maxi == r:
	final[0] = o[0] + 1
	final[1] = o[1]
if maxi == l:
	final[0] = o[0] - 1
	final[1] = o[1]
if maxi == u:
	final[0] = o[0]
	final[1] = o[1] + 1
if maxi == d:
	final[0] = o[0]
	final[1] = o[1] - 1
print(maxi)
print(final[0], final[1])


from sys import stdin
input = stdin.readline
(n, x_s, y_s) = map(int, input().split())
x = [0] * n
y = [0] * n
g = 0
d = 0
p = 0
l = 0
for i in range(n):
	(a, b) = map(int, input().split())
	x[i] = a - x_s
	y[i] = b - y_s
	if x[i] > 0:
		p += 1
	if x[i] < 0:
		l += 1
	if y[i] > 0:
		g += 1
	if y[i] < 0:
		d += 1
c = max(g, d, p, l)
import sys
print(c)
if g == c:
	print(x_s, y_s + 1)
	sys.exit(0)
if d == c:
	print(x_s, y_s - 1)
	sys.exit(0)
if p == c:
	print(x_s + 1, y_s)
	sys.exit(0)
if l == c:
	print(x_s - 1, y_s)
	sys.exit(0)


def main():
	(n, sx, sy) = map(int, input().split())
	a = []
	cnt1 = cnt2 = cnt3 = cnt4 = 0
	ny34 = ny12 = nx23 = nx14 = 0
	for _ in range(n):
		(x, y) = map(int, input().split())
		x -= sx
		y -= sy
		if x > 0:
			if y > 0:
				cnt1 += 1
			if y < 0:
				cnt4 += 1
		if x < 0:
			if y > 0:
				cnt2 += 1
			if y < 0:
				cnt3 += 1
		if x == 0:
			if y > 0:
				ny12 += 1
			else:
				ny34 += 1
		if y == 0:
			if x > 0:
				nx14 += 1
			else:
				nx23 += 1
	if cnt1 + cnt4 + nx14 == max(cnt1 + cnt4 + nx14, cnt1 + cnt2 + ny12, cnt2 + cnt3 + nx23, cnt3 + cnt4 + ny34):
		print(cnt1 + cnt4 + nx14)
		print(sx + 1, sy)
	elif cnt1 + cnt2 + ny12 == max(cnt1 + cnt4 + nx14, cnt1 + cnt2 + ny12, cnt2 + cnt3 + nx23, cnt3 + cnt4 + ny34):
		print(cnt1 + cnt2 + ny12)
		print(sx, sy + 1)
	elif cnt3 + cnt2 + nx23 == max(cnt1 + cnt4 + nx14, cnt1 + cnt2 + ny12, cnt2 + cnt3 + nx23, cnt3 + cnt4 + ny34):
		print(cnt3 + cnt2 + nx23)
		print(sx - 1, sy)
	elif cnt3 + cnt4 + ny34 == max(cnt1 + cnt4 + nx14, cnt1 + cnt2 + ny12, cnt2 + cnt3 + nx23, cnt3 + cnt4 + ny34):
		print(cnt3 + cnt4 + ny34)
		print(sx, sy - 1)
main()


from sys import stdin, stdout
(n, sx, sy) = [int(s) for s in stdin.readline().split()]
points = []
for i in range(n):
	points.append([int(s) for s in stdin.readline().split()])
for i in range(n):
	points[i][0] = points[i][0] - sx
	points[i][1] = points[i][1] - sy
right = 0
left = 0
up = 0
down = 0
for i in range(n):
	x = points[i][0]
	y = points[i][1]
	if x > 0:
		right = right + 1
	if y > 0:
		up = up + 1
	if x < 0:
		left = left + 1
	if y < 0:
		down = down + 1
no_of_student = max(right, left, up, down)
if right == no_of_student:
	ans_x = sx + 1
	ans_y = sy
elif left == no_of_student:
	ans_x = sx - 1
	ans_y = sy
elif up == no_of_student:
	ans_x = sx
	ans_y = sy + 1
else:
	ans_x = sx
	ans_y = sy - 1
stdout.write('{}\n'.format(no_of_student))
stdout.write('{} {}'.format(ans_x, ans_y))


(n, s1, s2) = map(int, input().split())
count = [0, 0, 0, 0]
min_point = [[0, 0], [0, 0], [0, 0], [0, 0]]
for i in range(n):
	(x, y) = map(int, input().split())
	if x <= s1 and y < s2:
		if count[0] == 0:
			min_point[0] = [x, y]
		count[0] += 1
		if x >= min_point[0][0]:
			min_point[0][0] = x
		if y >= min_point[0][1]:
			min_point[0][1] = y
	if x > s1 and y <= s2:
		if count[1] == 0:
			min_point[1] = [x, y]
		count[1] += 1
		if x <= min_point[1][0]:
			min_point[1][0] = x
		if y >= min_point[1][1]:
			min_point[1][1] = y
	if x >= s1 and y > s2:
		if count[2] == 0:
			min_point[2] = [x, y]
		count[2] += 1
		if x <= min_point[2][0]:
			min_point[2][0] = x
		if y <= min_point[2][1]:
			min_point[2][1] = y
	if x < s1 and y >= s2:
		if count[3] == 0:
			min_point[3] = [x, y]
		count[3] += 1
		if x >= min_point[3][0]:
			min_point[3][0] = x
		if y <= min_point[3][1]:
			min_point[3][1] = y

def check_point(start, end, pos):
	tem1 = min(start[0], end[0]) <= pos[0] and pos[0] <= max(start[0], end[0])
	tem2 = min(start[1], end[1]) <= pos[1] and pos[1] <= max(start[1], end[1])
	return tem1 and tem2
points = []
final_count = []
for (i, j) in [(1, 0), (-1, 0), (0, 1), (0, -1)]:
	points.append((s1 + i, s2 + j))
	tem = 0
	for (e, p) in enumerate(min_point):
		if count[e] == 0:
			continue
		if check_point(pos=[s1 + i, s2 + j], end=[s1, s2], start=p):
			tem += count[e]
	final_count.append(tem)
max_idx = 0
for i in range(len(count)):
	if final_count[i] >= final_count[max_idx]:
		max_idx = i
print(final_count[max_idx])
print(*points[max_idx])


(n, s_x, s_y) = map(int, input().split())
x_plus = 0
x_minus = 0
y_plus = 0
y_minus = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > s_x:
		x_plus += 1
	elif x < s_x:
		x_minus += 1
	if y > s_y:
		y_plus += 1
	elif y < s_y:
		y_minus += 1
if x_plus >= max(y_plus, y_minus, x_minus):
	print(x_plus)
	print(s_x + 1, s_y)
elif x_minus >= max(x_plus, y_plus, y_minus):
	print(x_minus)
	print(s_x - 1, s_y)
elif y_plus >= max(x_plus, y_minus, x_minus):
	print(y_plus)
	print(s_x, s_y + 1)
else:
	print(y_minus)
	print(s_x, s_y - 1)


(n, sx, sy) = map(int, input().split(' '))
t = []
for i in range(n):
	t.append(list(map(int, input().split(' '))))
cnt_xl = 0
cnt_xm = 0
cnt_yl = 0
cnt_ym = 0
for i in range(n):
	if t[i][0] > sx:
		cnt_xm = cnt_xm + 1
	elif t[i][0] < sx:
		cnt_xl = cnt_xl + 1
	if t[i][1] > sy:
		cnt_ym = cnt_ym + 1
	elif t[i][1] < sy:
		cnt_yl = cnt_yl + 1
ans = 0
(px, py) = (0, 0)
if cnt_xm > cnt_xl:
	ans = cnt_xm
	(px, py) = (1, 0)
else:
	ans = cnt_xl
	(px, py) = (-1, 0)
if ans < cnt_ym:
	ans = cnt_ym
	(px, py) = (0, 1)
if ans < cnt_yl:
	ans = cnt_yl
	(px, py) = (0, -1)
print(ans)
print(sx + px, sy + py)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
(N, sx, sy) = MAP()
XY = []
for i in range(N):
	(x, y) = MAP()
	XY.append((x, y))
a = b = c = d = 0
for (x, y) in XY:
	if x <= sx - 1:
		a += 1
	if x >= sx + 1:
		b += 1
	if y <= sy - 1:
		c += 1
	if y >= sy + 1:
		d += 1
mx = max(a, b, c, d)
print(mx)
if mx == a:
	print(sx - 1, sy)
elif mx == b:
	print(sx + 1, sy)
elif mx == c:
	print(sx, sy - 1)
else:
	print(sx, sy + 1)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
(n, x, y) = value()
cd = 0
cl = 0
cr = 0
cu = 0
for i in range(n):
	(x1, y1) = value()
	if x1 < x:
		cl += 1
	elif x1 > x:
		cr += 1
	if y1 < y:
		cd += 1
	elif y1 > y:
		cu += 1
mx = max(cl, cu, cd, cr)
ans = (0, 0)
if mx == cl:
	ans = (x - 1, y)
elif mx == cr:
	ans = (x + 1, y)
elif mx == cu:
	ans = (x, y + 1)
else:
	ans = (x, y - 1)
print(mx)
print(*ans)


import sys
input = sys.stdin.readline
(n, sx, sy) = [int(item) for item in input().split()]
tents = [0] * 4
for i in range(n):
	(x, y) = [int(item) for item in input().split()]
	if y > sy:
		tents[0] += 1
	if y < sy:
		tents[2] += 1
	if x > sx:
		tents[1] += 1
	if x < sx:
		tents[3] += 1
cnt = max(tents)
max_id = tents.index(cnt)
print(cnt)
if max_id == 0:
	print(sx, sy + 1)
elif max_id == 1:
	print(sx + 1, sy)
elif max_id == 2:
	print(sx, sy - 1)
elif max_id == 3:
	print(sx - 1, sy)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
(n, x, y) = map(int, input().split())
cnt1 = 0
cnt2 = 0
cnt3 = 0
cnt4 = 0
ha = []
for i in range(n):
	(a, b) = map(int, input().split())
	ha.append([a, b])
	if a > x:
		cnt1 += 1
	if b > y:
		cnt2 += 1
	if a < x:
		cnt3 += 1
	if b < y:
		cnt4 += 1
z = max(cnt1, cnt2, cnt3, cnt4)
print(z)
if z == cnt1:
	mini = inf
	print(x + 1, y)
elif z == cnt2:
	mini = inf
	print(x, y + 1)
elif z == cnt3:
	mini = inf
	print(x - 1, y)
elif z == cnt4:
	mini = inf
	print(x, y - 1)


import sys

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())
(n, sx, sy) = rint()
xy = []
c = [0 for i in range(8)]
for i in range(n):
	(x, y) = rint()
	if x < sx:
		if y == sy:
			c[7] += 1
		elif y > sy:
			c[0] += 1
			c[1] += 1
			c[7] += 1
		else:
			c[7] += 1
			c[6] += 1
			c[5] += 1
	elif x == sx:
		if y > sy:
			c[1] += 1
		elif y < sy:
			c[5] += 1
	elif x > sx:
		if y == sy:
			c[3] += 1
		elif y > sy:
			c[1] += 1
			c[2] += 1
			c[3] += 1
		else:
			c[3] += 1
			c[4] += 1
			c[5] += 1
maxc = max(c)
if maxc == c[0]:
	ans = [sx - 1, sy + 1]
elif maxc == c[1]:
	ans = [sx, sy + 1]
elif maxc == c[2]:
	ans = [sx + 1, sy + 1]
elif maxc == c[3]:
	ans = [sx + 1, sy]
elif maxc == c[4]:
	ans = [sx + 1, sy - 1]
elif maxc == c[5]:
	ans = [sx, sy - 1]
elif maxc == c[6]:
	ans = [sx - 1, sy - 1]
elif maxc == c[7]:
	ans = [sx - 1, sy]
print(maxc)
print(*ans)


import sys
(n, sx, sy) = map(int, sys.stdin.readline().strip().split())
g = []
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	g.append([x, y])
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
ans = 0
for dr in range(4):
	tentx = int(sx + dx[dr])
	tenty = int(sy + dy[dr])
	if tentx < 0 or tentx > int(1000000000.0) or tenty < 0 or (tenty > int(1000000000.0)):
		continue
	cnt = 0
	for i in range(n):
		curx = int(g[i][0])
		cury = int(g[i][1])
		if int(abs(curx - tentx)) + int(abs(cury - tenty)) + int(abs(tentx - sx)) + int(abs(tenty - sy)) == int(abs(curx - sx)) + int(abs(cury - sy)):
			cnt += 1
	if ans < cnt:
		ans = cnt
		mX = tentx
		mY = tenty
print(ans)
print(mX, mY)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, sx, sy) = map(int, input().split())
x = []
y = []
for i in range(n):
	(x1, y1) = map(int, input().split())
	x.append(x1)
	y.append(y1)
c1 = 0
m1 = -float('inf')
c2 = 0
m2 = float('inf')
for j in range(n):
	if x[j] < sx:
		c1 += 1
		m1 = max(m1, x[j])
	elif x[j] > sx:
		c2 += 1
		m2 = min(m2, x[j])
	j += 1
c3 = 0
m3 = -float('inf')
c4 = 0
m4 = float('inf')
for j in range(n):
	if y[j] < sy:
		c3 += 1
		m3 = max(m3, y[j])
	elif y[j] > sy:
		c4 += 1
		m4 = min(m4, y[j])
	j += 1
m = max(c1, c2, c3, c4)
print(m)
if c1 == m:
	print(m1, sy)
elif c2 == m:
	print(m2, sy)
elif c3 == m:
	print(sx, m3)
elif c4 == m:
	print(sx, m4)


import sys
(n, sx, sy) = list(map(int, sys.stdin.readline().strip().split()))
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = list(map(int, sys.stdin.readline().strip().split()))
	if x < sx:
		a += 1
	if x > sx:
		b += 1
	if y > sy:
		c += 1
	if y < sy:
		d += 1
z = max(a, b, c, d)
print(z)
if a == z:
	print(sx - 1, sy)
elif b == z:
	print(sx + 1, sy)
elif c == z:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


(n, sx, sy) = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
pairs = [0, 0, 0, 0]
for (x, y) in a:
	x -= sx
	y -= sy
	if x == 0:
		pairs[2 * (y < 0)] += 1
	elif y == 0:
		pairs[1 + 2 * (x > 0)] += 1
	elif x > 0:
		if y > 0:
			pairs[0] += 1
		else:
			pairs[2] += 1
		pairs[3] += 1
	else:
		if y > 0:
			pairs[0] += 1
		else:
			pairs[2] += 1
		pairs[1] += 1
best = 0
bx = 0
by = 1
for ((x, y), v) in zip(((0, 1), (-1, 0), (0, -1), (1, 0)), pairs):
	if v > best:
		bx = x
		by = y
		best = v
print(best)
print(sx + bx, sy + by)


(n, sx, sy) = map(int, input().split())
p1 = 0
p2 = 0
p3 = 0
p4 = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x < sx:
		if y > sy:
			p1 += 1
			p2 += 1
		elif y < sy:
			p1 += 1
			p4 += 1
		else:
			p1 += 1
	elif x > sx:
		if y > sy:
			p2 += 1
			p3 += 1
		elif y < sy:
			p4 += 1
			p3 += 1
		else:
			p3 += 1
	elif y > sy:
		p2 += 1
	else:
		p4 += 1
if sx == 0:
	p1 = -1
if sy == 0:
	p4 = -1
if sy == 10 ** 9:
	p2 = -1
if sx == 10 ** 9:
	p3 = -1
k = max(p1, p2, p3, p4)
print(k)
if p1 == k:
	print(sx - 1, sy)
elif p2 == k:
	print(sx, sy + 1)
elif p3 == k:
	print(sx + 1, sy)
else:
	print(sx, sy - 1)


(n, x, y) = map(int, input().split())
XY = []
for i in range(n):
	(X, Y) = map(int, input().split())
	XY.append([X - x, Y - y])
xpl = 0
xmi = 0
ypl = 0
ymi = 0
for i in range(n):
	if XY[i][0] > 0:
		xpl += 1
	if XY[i][0] < 0:
		xmi += 1
	if XY[i][1] > 0:
		ypl += 1
	if XY[i][1] < 0:
		ymi += 1
if x - 1 < 0:
	xmi = -1
if x + 1 > 10 ** 9:
	xpl = -1
if y - 1 < 0:
	ymi = -1
if y + 1 > 10 ** 9:
	ypl = -1
nm = max(xpl, xmi, ypl, ymi)
print(nm)
if nm == xpl:
	print(x + 1, y)
elif nm == xmi:
	print(x - 1, y)
elif nm == ypl:
	print(x, y + 1)
else:
	print(x, y - 1)


(n, sx, sy) = [int(i) for i in input().split()]
l = []
for i in range(n):
	l.append([int(j) for j in input().split()])
q1 = 0
q2 = 0
q3 = 0
q4 = 0
for i in l:
	if i[0] <= sx and i[1] >= sy:
		q1 += 1
	if i[0] >= sx and i[1] >= sy:
		q2 += 1
	if i[0] >= sx and i[1] <= sy:
		q3 += 1
	if i[0] <= sx and i[1] <= sy:
		q4 += 1
x1 = 0
y1 = 0
x2 = 0
y2 = 0
for i in l:
	if i[1] == sy and i[0] <= sx:
		x1 += 1
	if i[0] == sx and i[1] <= sy:
		y1 += 1
	if i[1] == sy and i[0] >= sx:
		x2 += 1
	if i[0] == sx and i[1] >= sy:
		y2 += 1
temp = max(q1 + q2, q2 + q3, q3 + q4, q4 + q1)
if temp == q1 + q2:
	print(q1 + q2 - x1 - x2 - y2)
	print(sx, sy + 1)
elif temp == q2 + q3:
	print(q3 + q2 - y1 - y2 - x2)
	print(sx + 1, sy)
elif temp == q3 + q4:
	print(q3 + q4 - x1 - x2 - y2)
	print(sx, sy - 1)
else:
	print(q1 + q4 - y1 - y2 - x1)
	print(sx - 1, sy)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(n, sx, sy) = map(int, input().split())
i = [0] * n
i1 = [0] * n
for w in range(n):
	(i[w], i1[w]) = map(int, input().split())
i.sort()
i1.sort()
r = 0
r1 = 0
r2 = 0
r3 = 0
for w in range(n):
	if i[w] < sx:
		r += 1
	elif i[w] > sx:
		r1 += 1
	if i1[w] < sy:
		r2 += 1
	elif i1[w] > sy:
		r3 += 1
w = r1
w1 = r2
w2 = r
w3 = r3
p = max(w1, w2, w3, w)
print(p)
if p == w:
	print(sx + 1, sy)
elif p == w1:
	print(sx, sy - 1)
elif p == w2:
	print(sx - 1, sy)
elif p == w3:
	print(sx, sy + 1)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, schoolx, schooly) = get_ints()
first = second = third = fourth = 0
gx = gy = sx = sy = 0
for i in range(n):
	(x, y) = get_ints()
	if x > schoolx and y > schooly:
		first += 1
	elif x > schoolx and y < schooly:
		fourth += 1
	elif x < schoolx and y > schooly:
		second += 1
	elif x < schoolx and y < schooly:
		third += 1
	elif x == schoolx:
		if y > schooly:
			gy += 1
		else:
			sy += 1
	elif y == schooly:
		if x > schoolx:
			gx += 1
		else:
			gy += 1
maxi = 0
(ans1, ans2) = (0, 0)
if first + second + gy > maxi:
	maxi = first + gy + second
	(ans1, ans2) = (schoolx, schooly + 1)
if second + third + sx > maxi:
	maxi = second + third + sx
	(ans1, ans2) = (schoolx - 1, schooly)
if third + fourth + sy > maxi:
	maxi = third + fourth + sy
	(ans1, ans2) = (schoolx, schooly - 1)
if fourth + first + gx > maxi:
	maxi = fourth + first + gx
	(ans1, ans2) = (schoolx + 1, schooly)
print(maxi)
print(ans1, ans2)


import sys
input = sys.stdin.buffer.readline
(n, Sx, Sy) = [int(i) for i in input().split()]
Q1 = Q2 = Q3 = Q4 = N = E = S = W = 0
for i in range(n):
	(x, y) = [int(i) for i in input().split()]
	rel_x = x - Sx
	rel_y = y - Sy
	if y == Sy:
		if rel_x > 0:
			E += 1
		else:
			W += 1
	elif x == Sx:
		if rel_y > 0:
			N += 1
		else:
			S += 1
	elif rel_x > 0 and rel_y > 0:
		Q1 += 1
	elif rel_x < 0 and rel_y > 0:
		Q2 += 1
	elif rel_x < 0 and rel_y < 0:
		Q3 += 1
	else:
		Q4 += 1
U = Q1 + Q2 + N
D = Q3 + Q4 + S
R = Q1 + Q4 + E
L = Q2 + Q3 + W
ans = max(U, D, R, L)
px = py = 0
print(ans)
if ans == U:
	px = Sx
	py = Sy + 1
elif ans == D:
	px = Sx
	py = Sy - 1
elif ans == R:
	px = Sx + 1
	py = Sy
else:
	px = Sx - 1
	py = Sy
print(str(px) + ' ' + str(py))


import array
number = [int(x) for x in input().split()]
pp = 0
pm = 0
mp = 0
mm = 0
pn = 0
mn = 0
np = 0
nm = 0
for i in range(0, number[0]):
	arr = [int(x) for x in input().split()]
	if arr[0] > number[1] and arr[1] > number[2]:
		pp += 1
	if arr[0] > number[1] and arr[1] < number[2]:
		pm += 1
	if arr[0] < number[1] and arr[1] > number[2]:
		mp += 1
	if arr[0] < number[1] and arr[1] < number[2]:
		mm += 1
	if arr[0] > number[1] and arr[1] == number[2]:
		pn += 1
	if arr[0] < number[1] and arr[1] == number[2]:
		mn += 1
	if arr[0] == number[1] and arr[1] > number[2]:
		np += 1
	if arr[0] == number[1] and arr[1] < number[2]:
		nm += 1
maxx = max(pp + pm + pn, pm + mm + nm, mp + pp + np, mm + mp + mn)
print(maxx)
if maxx == pp + pm + pn:
	print(str(number[1] + 1) + ' ' + str(number[2]))
elif maxx == pm + mm + nm:
	print(str(number[1]) + ' ' + str(number[2] - 1))
elif maxx == mp + pp + np:
	print(str(number[1]) + ' ' + str(number[2] + 1))
elif maxx == mm + mp + mn:
	print(str(number[1] - 1) + ' ' + str(number[2]))


(n, x, y) = map(int, input().split())
z = [n] * 4
dx = (1, -1, 0, 0)
dy = (0, 0, 1, -1)
for _ in range(n):
	(xx, yy) = map(int, input().split())
	if xx <= x:
		z[0] -= 1
	if xx >= x:
		z[1] -= 1
	if yy <= y:
		z[2] -= 1
	if yy >= y:
		z[3] -= 1
m = max(z)
i = z.index(m)
print(m)
print(x + dx[i], y + dy[i])


(n, x, y) = map(int, input().split())
(first, second, third, fourth) = (0, 0, 0, 0)
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(p, q) = map(int, input().split())
	if p == x:
		if q < y:
			d += 1
		else:
			b += 1
	elif q == y:
		if p < x:
			c += 1
		else:
			a += 1
	elif p > x and q > y:
		first += 1
	elif p > x and q < y:
		fourth += 1
	elif p < x and q > y:
		second += 1
	else:
		third += 1
ans = max(first + fourth + a, first + second + b, second + third + c, third + fourth + d)
if ans == first + fourth + a:
	print(ans)
	print(x + 1, y)
elif ans == first + second + b:
	print(ans)
	print(x, y + 1)
elif ans == second + third + c:
	print(ans)
	print(x - 1, y)
else:
	print(ans)
	print(x, y - 1)


(n, sx, sy) = list(map(int, input().split()))
x = []
y = []
for i in range(n):
	a = list(map(int, input().split()))
	x.append(a[0])
	y.append(a[1])
count = [0, 0, 0, 0]
px = False
py = False
if max(x) != sx and min(x) != sx:
	px = True
if max(y) != sy and min(y) != sy:
	py = True
for i in range(n):
	if x[i] > sx and px:
		count[0] += 1
	if x[i] < sx and px:
		count[1] += 1
	if y[i] > sy and py:
		count[2] += 1
	if y[i] < sy and py:
		count[3] += 1
print(max(count))
if count.index(max(count)) == 0:
	print(f'{sx + 1} {sy}')
elif count.index(max(count)) == 1:
	print(f'{sx - 1} {sy}')
elif count.index(max(count)) == 2:
	print(f'{sx} {sy + 1}')
else:
	print(f'{sx} {sy - 1}')


import sys
import collections
import heapq
import math
import bisect
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rstr():
	return input().strip()

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
(n, x, y) = rints()
(a, b, c, d) = (0, 0, 0, 0)
for _ in range(n):
	(u, v) = rints()
	if u < x:
		a += 1
	elif u > x:
		b += 1
	if v < y:
		c += 1
	elif v > y:
		d += 1
mx = max(a, b, c, d)
print(mx)
if mx == a:
	print(x - 1, y)
elif mx == b:
	print(x + 1, y)
elif mx == c:
	print(x, y - 1)
else:
	print(x, y + 1)


(n, u, v) = map(int, input().split())
pos = []
ans = [[u - 1, v], [u + 1, v], [u, v - 1], [u, v + 1]]
anss = [0, 0, 0, 0]
for i in range(n):
	(a, b) = map(int, input().split())
	if a < u:
		anss[0] += 1
		if b < v:
			anss[2] += 1
		if b > v:
			anss[3] += 1
	elif a == u:
		if b < v:
			anss[2] += 1
		else:
			anss[3] += 1
	else:
		anss[1] += 1
		if b < v:
			anss[2] += 1
		if b > v:
			anss[3] += 1
maxans = 0
for i in range(4):
	if anss[i] > maxans:
		maxans = anss[i]
		maxanss = ans[i]
print(maxans)
print(*maxanss)


(n, sx, sy) = map(int, input().split())
arr = []
for i in range(n):
	arr.append(list(map(int, input().split())))
dir_u = 0
dir_d = 0
dir_r = 0
dir_l = 0
if sx != 0:
	for i in range(n):
		if arr[i][0] > sx and arr[i][1] > sy:
			dir_r += 1
			dir_u += 1
		if arr[i][0] == sx and arr[i][1] >= sy:
			dir_u += 1
		if arr[i][0] < sx and arr[i][1] < sy:
			dir_d += 1
			dir_l += 1
		if arr[i][0] == sx and arr[i][1] <= sy:
			dir_d += 1
		if arr[i][0] < sx and arr[i][1] > sy:
			dir_u += 1
			dir_l += 1
		if arr[i][0] <= sy and arr[i][1] == sy:
			dir_l += 1
		if arr[i][0] > sx and arr[i][1] < sy:
			dir_d += 1
			dir_r += 1
		if arr[i][0] >= sx and arr[i][1] == sy:
			dir_r += 1
	if dir_u >= dir_d and dir_u >= dir_l and (dir_u >= dir_r):
		print(dir_u)
		print(sx, sy + 1)
	elif dir_r >= dir_d and dir_r >= dir_l and (dir_r >= dir_u):
		print(dir_r)
		print(sx + 1, sy)
	elif dir_d >= dir_u and dir_d >= dir_l and (dir_d >= dir_r):
		print(dir_d)
		print(sx, sy - 1)
	else:
		print(dir_l)
		print(sx - 1, sy)


from sys import stdin
import math

def input():
	return stdin.readline()[:-1]
(n, sx, sy) = map(int, input().split())
(up, down, left, right) = [0] * 4
for _ in range(n):
	(x, y) = map(int, input().split())
	if y > sy:
		up += 1
	if y < sy:
		down += 1
	if x > sx:
		right += 1
	if x < sx:
		left += 1
mx = max(up, down, left, right)
if up == mx and sy < 10 ** 9:
	print(up)
	print(sx, sy + 1)
elif down == mx and sy > 0:
	print(down)
	print(sx, sy - 1)
elif right == mx and sx < 10 ** 9:
	print(right)
	print(sx + 1, sy)
elif left == mx and sx > 0:
	print(left)
	print(sx - 1, sy)


(n, sx, sy) = map(int, input().split())
a1 = 0
a2 = 0
a3 = 0
a4 = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		a1 += 1
	if x < sx:
		a2 += 1
	if y > sy:
		a3 += 1
	if y < sy:
		a4 += 1
if a1 == max(a1, a2, a3, a4):
	print(a1)
	print(sx + 1, sy)
elif a2 == max(a1, a2, a3, a4):
	print(a2)
	print(sx - 1, sy)
elif a3 == max(a1, a2, a3, a4):
	print(a3)
	print(sx, sy + 1)
else:
	print(a4)
	print(sx, sy - 1)


(n, x, y) = [int(x) for x in input().split()]
haut = 0
bas = 0
gauche = 0
droite = 0
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	if b > y:
		haut += 1
	elif b < y:
		bas += 1
	if a < x:
		gauche += 1
	elif a > x:
		droite += 1
label = max(haut, bas, gauche, droite)
print(label)
if haut == label:
	print(f'{x} {y + 1}')
elif label == bas:
	print(f'{x} {y - 1}')
elif label == gauche:
	print(f'{x - 1} {y}')
else:
	print(f'{x + 1} {y}')


import sys
import math as mt
input = sys.stdin.buffer.readline
t = 1
for __ in range(t):
	(n, sx, sy) = map(int, input().split())
	(p1x, p1y) = (sx + 1, sy)
	(p2x, p2y) = (sx - 1, sy)
	(p3x, p3y) = (sx, sy + 1)
	(p4x, p4y) = (sx, sy - 1)
	(p1, p2, p3, p4) = (0, 0, 0, 0)
	for i in range(n):
		(x, y) = map(int, input().split())
		dist = abs(x - sx) + abs(y - sy)
		if dist == abs(x - p1x) + abs(y - p1y) + 1:
			p1 += 1
		if dist == abs(x - p2x) + abs(y - p2y) + 1:
			p2 += 1
		if dist == abs(x - p3x) + abs(y - p3y) + 1:
			p3 += 1
		if dist == abs(x - p4x) + abs(y - p4y) + 1:
			p4 += 1
	ch = 0
	if p1 == max(p1, p2, p3, p4) and ch == 0:
		print(p1)
		print(p1x, p1y)
		ch = 1
	if p2 == max(p1, p2, p3, p4) and ch == 0:
		ch = 1
		print(p2)
		print(p2x, p2y)
	if p3 == max(p1, p2, p3, p4) and ch == 0:
		ch = 1
		print(p3)
		print(p3x, p3y)
	if p4 == max(p1, p2, p3, p4) and ch == 0:
		ch = 1
		print(p4)
		print(p4x, p4y)


a = []
b = []
xx = []
ans = 0
ansx = 0
ansy = 0

def main():
	ans = [0, 0, 0, 0]
	(n, s1, s2) = [int(n) for n in input().split()]
	for i in range(n):
		(a1, a2) = [int(n) for n in input().split()]
		if a1 < s1:
			ans[0] += 1
		if a1 > s1:
			ans[2] += 1
		if a2 < s2:
			ans[3] += 1
		if a2 > s2:
			ans[1] += 1
	dx = [-1, 0, 1, 0]
	dy = [0, 1, 0, -1]
	res = 0
	for i in range(0, 4):
		if res < ans[i]:
			res = ans[i]
			ansx = s1 + dx[i]
			ansy = s2 + dy[i]
	print(res)
	print('{} {}'.format(ansx, ansy))
main()


(n, sx, sy) = list(map(int, input().split()))
(t, b, l, r) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = list(map(int, input().split()))
	if x > sx:
		r += 1
	elif x < sx:
		l += 1
	if y > sy:
		t += 1
	elif y < sy:
		b += 1
mx = max(t, b, l, r)
ans = [mx, 0, 0]
if mx == t:
	ans[1] = sx
	ans[2] = sy + 1
elif mx == b:
	ans[1] = sx
	ans[2] = sy - 1
elif mx == l:
	ans[1] = sx - 1
	ans[2] = sy
elif mx == r:
	ans[1] = sx + 1
	ans[2] = sy
print(mx)
print(ans[1], ans[2])


(n, sx, sy) = [int(x) for x in input().split()]
u = 0
d = 0
l = 0
r = 0
for i in range(n):
	(px, py) = [int(x) for x in input().split()]
	if px > sx:
		r += 1
	elif px < sx:
		l += 1
	if py > sy:
		u += 1
	elif py < sy:
		d += 1
if u >= d and u >= l and (u >= r):
	print(u)
	print(sx, sy + 1)
elif d >= u and d >= l and (d >= r):
	print(d)
	print(sx, sy - 1)
elif l >= u and l >= d and (l >= r):
	print(l)
	print(sx - 1, sy)
else:
	print(r)
	print(sx + 1, sy)


from sys import stdin

def input():
	return next(stdin)

def main():
	(n, sx, sy) = map(int, input().split())
	dc = [0] * 4
	for _ in range(n):
		(x, y) = map(int, input().split())
		if y < sy:
			dc[0] += 1
		elif y > sy:
			dc[2] += 1
		if x < sx:
			dc[3] += 1
		elif x > sx:
			dc[1] += 1
	best = 0
	besti = 0
	for i in range(4):
		if dc[i] > best:
			besti = i
			best = dc[i]
	if besti == 0:
		rx = sx
		ry = sy - 1
	elif besti == 1:
		rx = sx + 1
		ry = sy
	elif besti == 2:
		rx = sx
		ry = sy + 1
	else:
		rx = sx - 1
		ry = sy
	print(best)
	print(rx, ry)
main()


import sys
import collections
from collections import Counter
import itertools
import math
import timeit
input = sys.stdin.readline

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
(n, x, y) = mi()
up = down = left = right = 0
for _ in range(n):
	(a, b) = mi()
	if a > x:
		right += 1
	elif a < x:
		left += 1
	if b > y:
		up += 1
	elif b < y:
		down += 1
t = max(up, down, left, right)
if t == up:
	print(up, f'{x} {y + 1}', sep='\n')
elif t == down:
	print(down, f'{x} {y - 1}', sep='\n')
elif t == left:
	print(left, f'{x - 1} {y}', sep='\n')
else:
	print(right, f'{x + 1} {y}', sep='\n')


(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))


import sys

def dist(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
[n, sx, sy] = [int(i) for i in sys.stdin.readline().split()]
coord = []
for i in range(n):
	[x, y] = [int(j) for j in sys.stdin.readline().split()]
	coord.append([x, y])
arr = [-1, 0, 1]
ans_arr = [0, 0]
ans = 0
for a in range(len(arr)):
	for b in range(len(arr)):
		if not (arr[a] == 0 and arr[b] == 0):
			xc = sx + arr[a]
			yc = sy + arr[b]
			count = 0
			if 0 <= xc <= pow(10, 9) and 0 <= yc <= pow(10, 9):
				for g in range(n):
					if dist(xc, yc, coord[g][0], coord[g][1]) < dist(sx, sy, coord[g][0], coord[g][1]):
						count += 1
			if count > ans:
				ans = count
				ans_arr[0] = xc
				ans_arr[1] = yc
print(ans)
print(ans_arr[0], ans_arr[1])


f = list(map(int, input().split()))
a = []
b = [0, 0, 0, 0]
for i in range(f[0]):
	a.append(list(map(int, input().split())))
for i in range(f[0]):
	if a[i][0] - f[1] > 0:
		b[0] += 1
	if a[i][0] - f[1] < 0:
		b[1] += 1
	if a[i][1] - f[2] > 0:
		b[2] += 1
	if a[i][1] - f[2] < 0:
		b[3] += 1
print(max(b))
if b[0] == max(b):
	print(f[1] + 1, f[2])
elif b[1] == max(b):
	print(f[1] - 1, f[2])
elif b[2] == max(b):
	print(f[1], f[2] + 1)
elif b[3] == max(b):
	print(f[1], f[2] - 1)


import sys
import math
import itertools
import collections

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
(n, sx, sy) = mi()
p = [[sx + 1, sy], [sx, sy + 1], [sx - 1, sy], [sx, sy - 1]]
ans = [0] * 4
a = [0] * 4
for _ in range(n):
	(x, y) = mi()
	if x > sx and y == sy:
		a[0] += 1
	elif x == sx and y > sy:
		a[1] += 1
	elif x < sx and y == sy:
		a[2] += 1
	elif x == sx and y < sy:
		a[3] += 1
	elif x >= sx + 1 and y >= sy + 1:
		ans[0] += 1
	elif y >= sy + 1 and x <= sx - 1:
		ans[1] += 1
	elif x <= sx - 1 and y <= sy - 1:
		ans[2] += 1
	elif y <= sy - 1 and x >= sx + 1:
		ans[3] += 1
res = [ans[3] + a[0] + ans[0], ans[0] + a[1] + ans[1], ans[1] + a[2] + ans[2], ans[2] + a[3] + ans[3]]
print(max(res))
print(wr(p[res.index(max(res))]))


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
top = 0
left = 0
right = 0
bottom = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if y < sy:
		top += 1
	elif y > sy:
		bottom += 1
	if x > sx:
		right += 1
	elif x < sx:
		left += 1
if max(top, left, right, bottom) == top:
	print(top)
	print(sx, sy - 1)
elif max(top, left, right, bottom) == left:
	print(left)
	print(sx - 1, sy)
elif max(top, left, right, bottom) == right:
	print(right)
	print(sx + 1, sy)
else:
	print(bottom)
	print(sx, sy + 1)


(a, b, c) = map(int, input().split())
up = 0
down = 0
left = 0
right = 0
for i in range(a):
	(m, n) = map(int, input().split())
	if m > b:
		right += 1
	if m < b:
		left += 1
	if n > c:
		up += 1
	if n < c:
		down += 1
p = max(up, down, left, right)
print(str(p))
if up == p:
	print(str(b) + ' ' + str(c + 1))
elif down == p:
	print(str(b) + ' ' + str(c - 1))
elif left == p:
	print(str(b - 1) + ' ' + str(c))
elif right == p:
	print(str(b + 1) + ' ' + str(c))


(n, sx, sy) = map(int, input().split())
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	if x < sx:
		a += 1
	if x > sx:
		b += 1
	if y < sy:
		c += 1
	if y > sy:
		d += 1
	tmp = max(a, b, c, d)
if tmp == a:
	print(a)
	print(sx - 1, sy, sep=' ')
elif tmp == b:
	print(b)
	print(sx + 1, sy, sep=' ')
elif tmp == c:
	print(c)
	print(sx, sy - 1, sep=' ')
elif tmp == d:
	print(d)
	print(sx, sy + 1, sep=' ')


import sys
input = lambda : sys.stdin.readline().rstrip()
(n, sx, sy) = map(int, input().split())
xy = []
for _ in range(n):
	(x, y) = map(int, input().split())
	xy.append((x, y))
mx = -1
tmp = sum((1 for (x, y) in xy if x > sx))
if tmp > mx:
	mx = tmp
	ans = (sx + 1, sy)
tmp = sum((1 for (x, y) in xy if x < sx))
if tmp > mx:
	mx = tmp
	ans = (sx - 1, sy)
tmp = sum((1 for (x, y) in xy if y > sy))
if tmp > mx:
	mx = tmp
	ans = (sx, sy + 1)
tmp = sum((1 for (x, y) in xy if y < sy))
if tmp > mx:
	mx = tmp
	ans = (sx, sy - 1)
print(mx)
print(*ans)


x = input().split(' ')
a = int(x[0])
b = int(x[1])
c = int(x[2])
n = 0
w = 0
e = 0
s = 0
for i in range(a):
	z = input().split(' ')
	b1 = int(z[0])
	c1 = int(z[1])
	if b > b1:
		w += 1
	if b < b1:
		e += 1
	if c > c1:
		s += 1
	if c < c1:
		n += 1
if max(n, w, e, s) == n:
	print(n)
	print(b, c + 1)
elif max(n, w, e, s) == s:
	print(s)
	print(b, c - 1)
elif max(n, w, e, s) == e:
	print(e)
	print(b + 1, c)
elif max(n, w, e, s) == w:
	print(w)
	print(b - 1, c)


from os import path
import sys
from math import ceil, floor, gcd, log, log2
from collections import defaultdict, Counter
from itertools import permutations
maxx = float('inf')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()

	def grid(r, c):
		return [lint() for i in range(r)]
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
else:
	I = lambda : int(sys.stdin.buffer.readline())
	tup = lambda : map(int, sys.stdin.buffer.readline().split())
	lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
	S = lambda : sys.stdin.readline().replace('\n', '').strip()

	def grid(r, c):
		return [lint() for i in range(r)]
	stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
	star = lambda x: print(' '.join(map(str, x)))
(n, x, y) = tup()
(ar, d) = ([], defaultdict(list))
for i in range(n):
	(a, b) = tup()
	ar.append((a, b))
d = {(x + 1, y): 0, (x, y + 1): 0, (x - 1, y): 0, (x, y - 1): 0}
for i in range(n):
	(p1, p2, p3, p4) = ((x + 1, y), (x, y + 1), (x - 1, y), (x, y - 1))
	if ar[i][0] >= p1[0]:
		d[p1] += 1
	if ar[i][1] >= p2[1]:
		d[p2] += 1
	if ar[i][0] <= p3[0]:
		d[p3] += 1
	if ar[i][1] <= p4[1]:
		d[p4] += 1
(m1, m2) = (-1, -1)
for i in d:
	if d[i] > m1:
		m1 = d[i]
		m2 = i
print(m1)
print(*m2)


(n, sx, sy) = map(int, input().split())
right = 0
left = 0
bott = 0
up = 0
for _ in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		right += 1
	if x < sx:
		left += 1
	if y > sy:
		up += 1
	if y < sy:
		bott += 1
maxx = max(right, left, bott, up)
if maxx == right:
	print(right)
	print(sx + 1, sy)
elif maxx == left:
	print(left)
	print(sx - 1, sy)
elif bott == maxx:
	print(bott)
	print(sx, sy - 1)
else:
	print(up)
	print(sx, sy + 1)


def distance(a, b, x, y):
	return abs(a - x) + abs(b - y)

def one_side(p, x, y, s1, s2):
	r = 0
	for i in p:
		if distance(i[0], i[1], x, y) + 1 == i[2]:
			r += 1
	return r
(n, x, y) = map(int, input().split())
all_paths = {}
p = []
north = 0
west = 0
south = 0
east = 0
for i in range(n):
	(p1, p2) = map(int, input().split())
	if p1 == x:
		if p2 > y:
			north += 1
		else:
			south += 1
	elif p2 == y:
		if p1 > x:
			east += 1
		else:
			west += 1
	elif p1 > x:
		east += 1
		if p2 > y:
			north += 1
		else:
			south += 1
	else:
		west += 1
		if p2 > y:
			north += 1
		else:
			south += 1
print(max([north, south, east, west]))
if max([north, south, east, west]) == north:
	print(x, y + 1)
elif max([north, south, east, west]) == south:
	print(x, y - 1)
elif max([north, south, east, west]) == east:
	print(x + 1, y)
elif max([north, south, east, west]) == west:
	print(x - 1, y)


(n, sx, sy) = list(map(int, input().split()))
a = 0
b = 0
c = 0
d = 0
for i in range(n):
	(x, y) = list(map(int, input().split()))
	if x >= sx + 1:
		a += 1
	if y >= sy + 1:
		b += 1
	if x <= sx - 1:
		c += 1
	if y <= sy - 1:
		d += 1
if a >= b and a >= c and (a >= d):
	print(a)
	print(sx + 1, end=' ')
	print(sy)
elif b >= a and b >= c and (b >= d):
	print(b)
	print(sx, end=' ')
	print(sy + 1)
elif c >= a and c >= b and (c >= d):
	print(c)
	print(sx - 1, end=' ')
	print(sy)
else:
	print(d)
	print(sx, end=' ')
	print(sy - 1)


(n, x, y) = map(int, input().split())
l = [0, 0, 0, 0]
c = [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]
for _ in range(n):
	(a, b) = map(int, input().split())
	if a >= x + 1:
		l[0] += 1
	if a <= x - 1:
		l[1] += 1
	if b >= y + 1:
		l[2] += 1
	if b <= y - 1:
		l[3] += 1
m = max(l)
print(m)
ind = l.index(m)
print(*c[ind])


(n, x, y) = map(int, input().split(' '))
N = S = W = E = 0
for i in range(n):
	(x1, y1) = map(int, input().split(' '))
	ydif = y1 - y
	xdif = x1 - x
	if xdif < 0:
		W += 1
	if xdif > 0:
		E += 1
	if ydif < 0:
		S += 1
	if ydif > 0:
		N += 1
if N == max(N, S, W, E):
	print(N)
	print(x, y + 1)
elif S == max(N, S, W, E):
	print(S)
	print(x, y - 1)
elif E == max(N, S, W, E):
	print(E)
	print(x + 1, y)
elif W == max(N, S, W, E):
	print(W)
	print(x - 1, y)


(n, x, y) = map(int, input().split())
(a, b, c, d) = (0, 0, 0, 0)
for i in range(n):
	(s, t) = map(int, input().split())
	if s < x:
		a += 1
	elif x < s:
		b += 1
	if y > t:
		c += 1
	elif t > y:
		d += 1
t = max(a, b, c, d)
print(t)
if a == t:
	print(x - 1, y)
elif b == t:
	print(x + 1, y)
elif c == t:
	print(x, y - 1)
else:
	print(x, y + 1)


(n, sx, sy) = map(int, input().split())
a = [0] * 4
for _ in range(n):
	(x, y) = map(int, input().split())
	x -= sx
	y -= sy
	if x > 0:
		a[0] += 1
	if x < 0:
		a[1] += 1
	if y > 0:
		a[2] += 1
	if y < 0:
		a[3] += 1
t = max(a)
print(t)
if a[0] == t:
	print(sx + 1, sy)
elif a[1] == t:
	print(sx - 1, sy)
elif a[2] == t:
	print(sx, sy + 1)
else:
	print(sx, sy - 1)


import sys
input = sys.stdin.buffer.readline
(N, sx, sy) = map(int, input().split())
x_plus = 0
x_minus = 0
y_plus = 0
y_minus = 0
for _ in range(N):
	(x, y) = map(int, input().split())
	if x > sx:
		x_plus += 1
	elif x < sx:
		x_minus += 1
	if y > sy:
		y_plus += 1
	elif y < sy:
		y_minus += 1
M = max(x_plus, x_minus, y_plus, y_minus)
print(M)
if x_plus == M:
	if sx + 1 <= 10 ** 9:
		print(sx + 1, sy)
elif x_minus == M:
	if sx - 1 >= 0:
		print(sx - 1, sy)
elif y_plus == M:
	if sy + 1 <= 10 ** 9:
		print(sx, sy + 1)
elif y_minus == M:
	if sy - 1 >= 0:
		print(sx, sy - 1)


import sys
(n, sx, sy) = map(int, sys.stdin.readline().split())
(left, right, up, down) = (0, 0, 0, 0)
for _ in range(n):
	(u, v) = map(int, sys.stdin.readline().split())
	if u < sx:
		left += 1
	if u > sx:
		right += 1
	if v < sy:
		down += 1
	if v > sy:
		up += 1
a = max(left, right, up, down)
if left == a:
	print(left)
	print(sx - 1, sy)
elif right == a:
	print(right)
	print(sx + 1, sy)
elif up == a:
	print(up)
	print(sx, sy + 1)
elif down == a:
	print(down)
	print(sx, sy - 1)


(n, sx, sy) = map(int, input().split())
(up, down, left, right) = (0, 0, 0, 0)
for i in range(n):
	(a, b) = map(int, input().split())
	if a > sx:
		right += 1
	elif a < sx:
		left += 1
	if b > sy:
		up += 1
	elif b < sy:
		down += 1
m = max(up, down, left, right)
print(m)
if m == up:
	print(sx, sy + 1)
elif m == down:
	print(sx, sy - 1)
elif m == left:
	print(sx - 1, sy)
else:
	print(sx + 1, sy)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from collections import defaultdict as dd
(n, sx, sy) = I()
(l, r, u, d) = (0, 0, 0, 0)
for i in range(n):
	(x, y) = I()
	if x == sx:
		if y < sy:
			d += 1
		else:
			u += 1
	elif y == sy:
		if x < sx:
			l += 1
		else:
			r += 1
	elif x > sx and y > sy:
		r += 1
		u += 1
	elif x < sx and y > sy:
		l += 1
		u += 1
	elif x > sx and y < sy:
		r += 1
		d += 1
	else:
		l += 1
		d += 1
m = max(l, r, u, d)
print(m)
if m == l:
	sx -= 1
elif m == r:
	sx += 1
elif m == u:
	sy += 1
else:
	sy -= 1
print(sx, sy)


(n, s1, s2) = map(int, input().split())
p1 = []
p2 = []
p3 = []
p4 = []
a = 0
b = 0
c = 0
d = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if s1 < x and s2 < y:
		a += 1
		b += 1
	elif s1 > x and s2 < y:
		b += 1
		c += 1
	elif s1 > x and s2 > y:
		c += 1
		d += 1
	elif s1 < x and s2 > y:
		d += 1
		a += 1
	elif x == s1 and y > s2:
		b += 1
	elif x == s1 and y < s2:
		d += 1
	elif y == s2 and x < s1:
		c += 1
	elif y == s2 and x > s1:
		a += 1
print(max(a, b, c, d))
if a == max(a, b, c, d):
	print(s1 + 1, s2)
elif b == max(a, b, c, d):
	print(s1, s2 + 1)
elif c == max(a, b, c, d):
	print(s1 - 1, s2)
elif d == max(a, b, c, d):
	print(s1, s2 - 1)


(n, sx, sy) = map(int, input().split())
boy = list()
for i in range(n):
	(x, y) = map(int, input().split())
	boy.append([x, y])
test = list()
test.append([0, sx, sy + 1])
test.append([0, sx + 1, sy])
test.append([0, sx, sy - 1])
test.append([0, sx - 1, sy])
for i in range(n):
	if boy[i][1] > sy:
		test[0][0] += 1
	if boy[i][1] < sy:
		test[2][0] += 1
	if boy[i][0] < sx:
		test[3][0] += 1
	if boy[i][0] > sx:
		test[1][0] += 1
for i in range(4):
	if test[i][1] < 0 or test[i][2] < 0:
		test[i][0] = 0
	if test[i][1] > 10 ** 9 or test[i][2] > 10 ** 9:
		test[i][0] = 0
test.sort(reverse=True)
print(test[0][0])
print(test[0][1], test[0][2])


(n, sx, sy) = map(int, input().split())
xu = xl = yu = yl = 0
for _ in range(n):
	(x, y) = map(int, input().split())
	if x > sx:
		xu += 1
	elif x < sx:
		xl += 1
	if y > sy:
		yu += 1
	elif y < sy:
		yl += 1
ans = max(xu, xl, yu, yl)
print(ans)
if xu == ans:
	print(sx + 1, sy)
elif xl == ans:
	print(sx - 1, sy)
elif yu == ans:
	print(sx, sy + 1)
elif yl == ans:
	print(sx, sy - 1)


import sys
input = sys.stdin.readline
(n, sx, sy) = map(int, input().split())
L = [0, 0, 0, 0]
for i in ' ' * n:
	(a, b) = map(int, input().split())
	if a - sx > 0:
		L[0] += 1
	if a - sx < 0:
		L[1] += 1
	if b - sy > 0:
		L[2] += 1
	if b - sy < 0:
		L[3] += 1
m = 0
mval = 0
for i in range(4):
	if L[i] > mval:
		m = i
		mval = L[i]
print(mval)
dir = [[1, 0], [-1, 0], [0, 1], [0, -1]]
print(sx + dir[m][0], sy + dir[m][1])


from sys import stdin, stdout

def inpu():
	return input().split(' ')

def inti(a):
	for i in range(len(a)):
		a[i] = int(a[i])
	return a

def inp():
	a = inpu()
	a = inti(a)
	return a
(n, sx, sy) = map(int, stdin.readline().split())
counts = {(1, 0): 0, (-1, 0): 0, (0, 1): 0, (0, -1): 0}
for _ in range(n):
	(x, y) = map(int, stdin.readline().split())
	if x > sx:
		counts[1, 0] += 1
	elif x < sx:
		counts[-1, 0] += 1
	if y > sy:
		counts[0, 1] += 1
	elif y < sy:
		counts[0, -1] += 1
(maxcount, ans) = (0, None)
for (d, v) in counts.items():
	if v > maxcount:
		(maxcount, ans) = (v, d)
stdout.write('{}\n{} {}'.format(maxcount, sx + ans[0], sy + ans[1]))


(n, sx, sy) = map(int, input().split())
cnts = [0, 0, 0, 0]
for _ in range(n):
	(x, y) = map(int, input().split())
	x -= sx
	y -= sy
	if x > 0:
		cnts[0] += 1
	if x < 0:
		cnts[1] += 1
	if y > 0:
		cnts[2] += 1
	if y < 0:
		cnts[3] += 1
print(max(cnts))
v = cnts.index(max(cnts))
res = [(sx + 1, sy), (sx - 1, sy), (sx, sy + 1), (sx, sy - 1)]
print(*res[v])


(n, Sx, Sy) = list(map(int, input().split()))
student_houses = [tuple(map(int, input().split())) for _ in range(n)]
from collections import defaultdict
students_SP = defaultdict(int)
neighbouring_coords = [(0, 1), (1, 0), (-1, 0), (0, -1)]
neighbouring_S = [(Sx + coord[0], Sy + coord[1]) for coord in neighbouring_coords]
for student_house in student_houses:
	Sx_b = Sx
	Sy_b = Sy
	xh = student_house[0]
	yh = student_house[1]
	if Sx_b > xh:
		(Sx_b, xh) = (xh, Sx_b)
	if Sy_b > yh:
		(Sy_b, yh) = (yh, Sy_b)
	for coord in neighbouring_S:
		if Sx_b <= coord[0] <= xh and Sy_b <= coord[1] <= yh:
			students_SP[coord] += 1
sortedItems = sorted(students_SP.items(), key=lambda x: x[1], reverse=True)
print(sortedItems[0][1])
print(' '.join(map(str, sortedItems[0][0])))