The Cybermen and the Daleks have long been the Doctor's main enemies. Everyone knows that both these species enjoy destroying everything they encounter. However, a little-known fact about them is that they both also love taking Turing tests!

Heidi designed a series of increasingly difficult tasks for them to spend their time on, which would allow the Doctor enough time to save innocent lives!

The funny part is that these tasks would be very easy for a human to solve.

The first task is as follows. There are some points on the plane. All but one of them are on the boundary of an axis-aligned square (its sides are parallel to the axes). Identify that point.


-----Input-----

The first line contains an integer $n$ ($2 \le n \le 10$).

Each of the following $4n + 1$ lines contains two integers $x_i, y_i$ ($0 \leq x_i, y_i \leq 50$), describing the coordinates of the next point.

It is guaranteed that there are at least $n$ points on each side of the square and all $4n + 1$ points are distinct.


-----Output-----

Print two integers — the coordinates of the point that is not on the boundary of the square.


-----Examples-----
Input
2
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2

Output
1 1

Input
2
0 0
0 1
0 2
0 3
1 0
1 2
2 0
2 1
2 2

Output
0 3



-----Note-----

In both examples, the square has four sides $x=0$, $x=2$, $y=0$, $y=2$.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Implementation


Solutions:
import sys
import os
from io import IOBase, BytesIO

def main():
	n = int(input())
	points = [0] * (4 * n + 1)
	for i in range(4 * n + 1):
		(a, b) = get_ints()
		points[i] = (a, b)
	l = 4 * n + 1
	for i in range(l):
		(mnx, mxx, mny, mxy) = (51, -1, 51, -1)
		for j in range(l):
			if i == j:
				continue
			x = points[j][0]
			y = points[j][1]
			mnx = min(mnx, x)
			mxx = max(mxx, x)
			mny = min(mny, y)
			mxy = max(mxy, y)
		flag = True
		for j in range(l):
			if i == j:
				continue
			x = points[j][0]
			y = points[j][1]
			if x != mnx and x != mxx and (y != mny) and (y != mxy):
				flag = False
		if flag == True and mxx - mnx == mxy - mny:
			print(points[i][0], points[i][1])
			return
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):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			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))

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

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

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


from sys import stdin, stdout

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def main():
	n = rsingle_int()
	num_p = 4 * n + 1
	points = []
	for i in range(num_p):
		points.append(rmult_int())
	point_x = {}
	for point in points:
		if point[0] not in point_x:
			point_x[point[0]] = 0
		point_x[point[0]] += 1
	point_y = {}
	for point in points:
		if point[1] not in point_y:
			point_y[point[1]] = 0
		point_y[point[1]] += 1
	x_min = 51
	x_max = -1
	for x_key in point_x.keys():
		if x_key > x_max and point_x[x_key] > 1:
			x_max = x_key
		if x_key < x_min and point_x[x_key] > 1:
			x_min = x_key
	y_min = 51
	y_max = -1
	for y_key in point_y.keys():
		if y_key > y_max and point_y[y_key] > 1:
			y_max = y_key
		if y_key < y_min and point_y[y_key] > 1:
			y_min = y_key
	found = False
	for point in points:
		if point[0] == x_max or point[0] == x_min:
			if not (point[1] <= y_max and point[1] >= y_min):
				found = True
		elif point[1] == y_max or point[1] == y_min:
			if not (point[0] <= x_max and point[0] >= x_min):
				found = True
		else:
			found = True
		if found:
			break
	if found:
		print('{} {}'.format(point[0], point[1]))
	else:
		print('Error')
main()


n = int(input())
p = []
dx = {}
dy = {}
min_x = None
max_x = None
min_y = None
max_y = None
for _ in range(4 * n + 1):
	(x, y) = map(int, input().split())
	p.append([x, y])
	if x not in dx:
		dx[x] = 0
	dx[x] += 1
	if y not in dy:
		dy[y] = 0
	dy[y] += 1
for x in sorted(dx.keys()):
	if dx[x] >= n:
		min_x = x
		break
for x in sorted(dx.keys())[::-1]:
	if dx[x] >= n:
		max_x = x
		break
for y in sorted(dy.keys()):
	if dy[y] >= n:
		min_y = y
		break
for y in sorted(dy.keys())[::-1]:
	if dy[y] >= n:
		max_y = y
		break
outlier = None
for (x, y) in p:
	if (x - min_x) * (x - max_x) <= 0 and (y - min_y) * (y - max_y) <= 0:
		if (x - min_x) * (x - max_x) < 0 and (y - min_y) * (y - max_y) < 0:
			outlier = (x, y)
			break
	else:
		outlier = (x, y)
		break
print(' '.join([str(x) for x in outlier]))


import sys
from collections import defaultdict
n = int(sys.stdin.readline())
(ver, hor) = (defaultdict(list), defaultdict(list))
points = []
for i in range(4 * n + 1):
	(x, y) = map(int, sys.stdin.readline().split())
	ver[y].append(x)
	hor[x].append(y)
	points.append([x, y])
(lh, lv) = ([], [])
for i in sorted(hor):
	if len(hor[i]) >= n:
		left = i
		break
for i in sorted(hor, reverse=True):
	if len(hor[i]) >= n:
		right = i
		break
for i in sorted(ver):
	if len(ver[i]) >= n:
		down = i
		break
for i in sorted(ver, reverse=True):
	if len(ver[i]) >= n:
		up = i
		break
for i in range(4 * n + 1):
	(x, y) = points[i]
	if x == left and down <= y <= up:
		continue
	if x == right and down <= y <= up:
		continue
	if y == down and left <= x <= right:
		continue
	if y == up and left <= x <= right:
		continue
	print(x, y)
	break


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))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def doi(it, l, t):
	for i in range(len(l)):
		if l[i][t] == it:
			print(l[i][0], l[i][1])
			return
n = int(input())
d = dict()
d1 = dict()
m = 0
m1 = 0
mi = 99999999999999999999
mi1 = 99999999999999999999
l = []
for i in range(4 * n + 1):
	(a, b) = map(int, input().split())
	l.append([a, b])
	m = max(a, m)
	mi = min(mi, a)
	m1 = max(b, m1)
	mi1 = min(mi1, b)
	if a in d:
		d[a] += 1
	else:
		d.update({a: 1})
	if b in d1:
		d1[b] += 1
	else:
		d1.update({b: 1})
if d[m] == 1:
	doi(m, l, 0)
elif d[mi] == 1:
	doi(mi, l, 0)
elif d1[mi1] == 1:
	doi(mi1, l, 1)
elif d1[m1] == 1:
	doi(m1, l, 1)
else:
	x1 = m
	x2 = mi
	y1 = m1
	y2 = mi1
	for i in range(len(l)):
		if l[i][0] == x1 and y2 <= l[i][1] <= y1:
			continue
		elif l[i][0] == x2 and y2 <= l[i][1] <= y1:
			continue
		elif l[i][1] == y1 and x2 <= l[i][0] <= x1:
			continue
		elif l[i][1] == y2 and x2 <= l[i][0] <= x1:
			continue
		else:
			print(l[i][0], l[i][1])
			break


def find_inside_point(points, maxx, minx, maxy, miny):
	for (x, y) in points:
		if minx < x < maxx and miny < y < maxy:
			print(x, y)
			return

def find_outside_point(points, maxx, minx, maxy, miny):
	maxx_points = [(x, y) for (x, y) in points if x == maxx]
	minx_points = [(x, y) for (x, y) in points if x == minx]
	maxy_points = [(x, y) for (x, y) in points if y == maxy]
	miny_points = [(x, y) for (x, y) in points if y == miny]
	if len(maxx_points) == 1:
		print(*maxx_points[0])
	elif len(minx_points) == 1:
		print(*minx_points[0])
	elif len(maxy_points) == 1:
		print(*maxy_points[0])
	else:
		print(*miny_points[0])

def process(n, points):
	(xs, ys) = ([x for (x, _) in points], [y for (_, y) in points])
	(maxx, minx) = (max(xs), min(xs))
	(maxy, miny) = (max(ys), min(ys))
	if maxx - minx == maxy - miny:
		find_inside_point(points, maxx, minx, maxy, miny)
	else:
		find_outside_point(points, maxx, minx, maxy, miny)

def __starting_point():
	n = int(input())
	points = []
	for _ in range(4 * n + 1):
		(x, y) = [int(z) for z in input().split()]
		points.append((x, y))
	process(n, points)
__starting_point()


n = int(input())
points = []
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	points.append((x, y))
max_x = count1 = max_y = count2 = count3 = count4 = 0
min_x = min_y = 51
for point in points:
	if point[0] > max_x:
		max_x = point[0]
	if point[0] < min_x:
		min_x = point[0]
	if point[1] > max_y:
		max_y = point[1]
	if point[1] < min_y:
		min_y = point[1]
for point in points:
	if point[0] == max_x:
		count1 += 1
	if point[0] == min_x:
		count2 += 1
	if point[1] == max_y:
		count3 += 1
	if point[1] == min_y:
		count4 += 1
if count1 == 1:
	for point in points:
		if point[0] == max_x:
			print(point[0], point[1])
			exit()
if count2 == 1:
	for point in points:
		if point[0] == min_x:
			print(point[0], point[1])
			exit()
if count3 == 1:
	for point in points:
		if point[1] == max_y:
			print(point[0], point[1])
			exit()
if count4 == 1:
	for point in points:
		if point[1] == min_y:
			print(point[0], point[1])
			exit()
for point in points:
	if point[0] != max_x and point[0] != min_x and (point[1] != max_y) and (point[1] != min_y):
		print(point[0], point[1])
		exit()


MAXV = 53

def is_on_border(x_min, x_max, y_min, y_max, x, y):
	if (x == x_min or x == x_max) and (y_min <= y and y <= y_max):
		return True
	return (y == y_min or y == y_max) and (x_min <= x and x <= x_max)

def unique_non_border(p, x_min, x_max, y_min, y_max):
	res = -1
	for i in range(len(p)):
		if not is_on_border(x_min, x_max, y_min, y_max, p[i][0], p[i][1]):
			if res != -1:
				return -1
			res = i
	return res

def sol(p):
	for l in range(1, MAXV + 1):
		for x in range(0, MAXV - l + 1):
			for y in range(0, MAXV - l + 1):
				res = unique_non_border(p, x, x + l, y, y + l)
				if res != -1:
					return res
	assert False
	return -1
n = int(input())
p = []
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	p.append((x, y))
ans = sol(p)
print(*p[ans])


n = int(input())
l = []
for i in range(4 * n + 1):
	(a, b) = list(map(int, input().split()))
	l.append([a, b])
x1 = -1
x2 = -1
y1 = -1
y2 = -1
h = [0] * 51
for i in range(4 * n + 1):
	h[l[i][0]] += 1
for i in range(51):
	if h[i] >= n and x1 == -1:
		x1 = i
	if h[50 - i] >= n and x2 == -1:
		x2 = 50 - i
h = [0] * 51
for i in range(4 * n + 1):
	h[l[i][1]] += 1
for i in range(51):
	if h[i] >= n and y1 == -1:
		y1 = i
	if h[50 - i] >= n and y2 == -1:
		y2 = 50 - i
for i in range(4 * n + 1):
	if l[i][0] == x1 or l[i][0] == x2:
		if not (l[i][1] >= y1 and l[i][1] <= y2):
			print(l[i][0], l[i][1])
			break
	elif l[i][1] == y1 or l[i][1] == y2:
		if not (l[i][0] >= x1 and l[i][0] <= x2):
			print(l[i][0], l[i][1])
			break
	else:
		print(l[i][0], l[i][1])
		break


n = int(input())
l = [list(map(int, input().split())) for _ in range(4 * n + 1)]
(x, y) = list(map(list, list(zip(*l))))
(hx, lx, hy, ly) = (max(x), min(x), max(y), min(y))

def find(w, i):
	for j in l:
		if j[w] == i:
			return j
if x.count(hx) == 1:
	print(*find(0, hx))
elif x.count(lx) == 1:
	print(*find(0, lx))
elif y.count(hy) == 1:
	print(*find(1, hy))
elif y.count(ly) == 1:
	print(*find(1, ly))
else:
	for i in l:
		if i[0] not in [hx, lx] and i[1] not in [hy, ly]:
			print(*i)
			break


import io, os
input = io.StringIO(os.read(0, os.fstat(0).st_size).decode()).readline
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
n = ii()
a = [li() for _ in range(4 * n + 1)]
lox = min((p[0] for p in a))
hix = max((p[0] for p in a))
loy = min((p[1] for p in a))
hiy = max((p[1] for p in a))
loxs = [i for i in range(len(a)) if a[i][0] == lox]
hixs = [i for i in range(len(a)) if a[i][0] == hix]
loys = [i for i in range(len(a)) if a[i][1] == loy]
hiys = [i for i in range(len(a)) if a[i][1] == hiy]
singles = [s for s in (loxs, hixs, loys, hiys) if len(s) == 1]
if not singles:
	alls = set(loxs + hixs + loys + hiys)
	ans = [i for i in range(len(a)) if i not in alls][0]
else:
	ans = singles[0][0]
print(*a[ans])


n = int(input())
length = 4 * n + 1
arr = [0] * length
maxX = 0
maxY = 0
minX = 50
minY = 50
for i in range(length):
	arr[i] = list(map(int, input().split(' ')))
	if maxX < arr[i][0]:
		maxX = arr[i][0]
	if minX > arr[i][0]:
		minX = arr[i][0]
	if maxY < arr[i][1]:
		maxY = arr[i][1]
	if minY > arr[i][1]:
		minY = arr[i][1]
cntMaxX = 0
cntMaxY = 0
cntMinX = 0
cntMinY = 0
for i in range(length):
	if arr[i][0] == maxX:
		cntMaxX += 1
	elif arr[i][0] == minX:
		cntMinX += 1
	if arr[i][1] == maxY:
		cntMaxY += 1
	elif arr[i][1] == minY:
		cntMinY += 1
if cntMaxX == 1:
	for i in range(length):
		if arr[i][0] == maxX:
			print(arr[i][0], arr[i][1])
elif cntMaxY == 1:
	for i in range(length):
		if arr[i][1] == maxY:
			print(arr[i][0], arr[i][1])
elif cntMinX == 1:
	for i in range(length):
		if arr[i][0] == minX:
			print(arr[i][0], arr[i][1])
elif cntMinY == 1:
	for i in range(length):
		if arr[i][1] == minY:
			print(arr[i][0], arr[i][1])
else:
	for i in range(length):
		x = arr[i][0]
		y = arr[i][1]
		if x > minX:
			if x < maxX:
				if y > minY:
					if y < maxY:
						print(x, y)


n = int(input())

def check(l):
	a = b = float('inf')
	c = d = 0
	for (x, y) in l:
		a = min(a, x)
		b = min(b, y)
		c = max(c, x)
		d = max(d, y)
	borders = [0] * 4
	for (x, y) in l:
		if x in {a, c}:
			if y < b or y > d:
				return False
			if x == a:
				borders[0] += 1
			else:
				borders[1] += 1
		if y in {b, d}:
			if x < a or x > c:
				return False
			if y == b:
				borders[2] += 1
			else:
				borders[3] += 1
		if x not in {a, c} and y not in {b, d}:
			return False
	return all((e >= n for e in borders))
l = [[*map(int, input().split())] for _ in range(4 * n + 1)]
for i in range(len(l)):
	if check(l[:i] + l[i + 1:]):
		print(*l[i])
		exit()


import sys
from operator import itemgetter
from fractions import gcd
from math import ceil, floor
from copy import deepcopy
from itertools import accumulate
from collections import Counter
import math
from functools import reduce
from bisect import bisect_right
sys.setrecursionlimit(200000)
input = sys.stdin.readline

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

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

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

def li():
	return list(input().rstrip())

def debug(x):
	print('debug: ', x, file=sys.stderr)

def main():
	n = ii()
	a = [tuple(mi()) for i in range(4 * n + 1)]
	for x in range(60):
		for y in range(60):
			for m in range(60):
				ans = []
				for i in range(4 * n + 1):
					if (x == a[i][0] or x + m == a[i][0]) and y <= a[i][1] <= y + m or ((y == a[i][1] or y + m == a[i][1]) and x <= a[i][0] <= x + m):
						continue
					else:
						ans.append(a[i])
				if len(ans) == 1:
					print(ans[0][0], ans[0][1])
					sys.exit()
main()


n = int(input())
xx = []
yy = []
countx = [0 for i in range(51)]
county = [0 for i in range(51)]
for _ in range(4 * n + 1):
	(x, y) = map(int, input().split(' '))
	xx.append(x)
	yy.append(y)
	countx[x] += 1
	county[y] += 1
xxx = []
yyy = []
for i in range(51):
	if countx[i] >= 2:
		xxx.append(i)
	if county[i] >= 2:
		yyy.append(i)
xmin = min(xxx)
xmax = max(xxx)
ymin = min(yyy)
ymax = max(yyy)
for i in range(4 * n + 1):
	if (xx[i] == xmin or xx[i] == xmax) and yy[i] <= ymax and (yy[i] >= ymin):
		continue
	elif (yy[i] == ymin or yy[i] == ymax) and xx[i] <= xmax and (xx[i] >= xmin):
		continue
	else:
		index = i
print(xx[index], yy[index])


from collections import defaultdict
n = int(input())
dx = defaultdict(int)
dy = defaultdict(int)
mx = my = 0
lx = ly = 100
s = set()
for i in range(4 * n + 1):
	(x, y) = list(map(int, input().split()))
	s.add((x, y))
	dx[x] += 1
	dy[y] += 1
	if dx[x] > 1:
		if x > mx:
			mx = x
		if x < lx:
			lx = x
	if dy[y] > 1:
		if y > my:
			my = y
		if y < ly:
			ly = y
for el in s:
	if lx < el[0] < mx and ly < el[1] < my or el[0] < lx or el[0] > mx or (el[1] < ly) or (el[1] > my):
		print(*el)


n = int(input())
arr = []
for i in range(4 * n + 1):
	str_ = input()
	(x, y) = str_.split()
	arr.append((int(x), int(y)))
arr.sort()
n1 = 4 * n + 1
i = 1
while arr[i][0] == arr[i - 1][0]:
	i += 1
if i == 1:
	print(str(arr[0][0]) + ' ' + str(arr[0][1]))
	exit()
low_x = arr[0][0]
i = n1 - 2
while arr[i][0] == arr[i + 1][0]:
	i -= 1
if i == n1 - 2:
	print(str(arr[n1 - 1][0]) + ' ' + str(arr[n1 - 1][1]))
	exit()
high_x = arr[n1 - 1][0]
for i in range(n1):
	arr[i] = (arr[i][1], arr[i][0])
arr.sort()
i = 1
while arr[i][0] == arr[i - 1][0]:
	i += 1
if i == 1:
	print(str(arr[0][1]) + ' ' + str(arr[0][0]))
	exit()
low_y = arr[0][0]
i = n1 - 2
while arr[i][0] == arr[i + 1][0]:
	i -= 1
if i == n1 - 2:
	print(str(arr[n1 - 1][1]) + ' ' + str(arr[n1 - 1][0]))
	exit()
high_y = arr[n1 - 1][0]
for i in range(n1):
	arr[i] = (arr[i][1], arr[i][0])
for i in range(n1):
	if not (arr[i][0] == low_x or arr[i][0] == high_x or arr[i][1] == low_y or (arr[i][1] == high_y)):
		print(str(arr[i][0]) + ' ' + str(arr[i][1]))
		exit()


n = int(input())
f = []
X = []
Y = []
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	f.append((x, y))
	X.append(x)
	Y.append(y)
l = min(X)
r = max(X)
d = min(Y)
u = max(Y)
if r - l == u - d:
	for i in f:
		if X.count(i[0]) == 1 and Y.count(i[1]) == 1:
			print(i[0], i[1])
			exit()
	for i in f:
		if l < i[0] < r and d < i[1] < u:
			print(i[0], i[1])
			exit()
else:
	for i in f:
		if X.count(i[0]) == 1 and Y.count(i[1]) == 1:
			print(i[0], i[1])
			exit()
	for i in f:
		if X.count(i[0]) == 1 and (i[0] == l or i[0] == r):
			print(i[0], i[1])
			exit()
		elif Y.count(i[1]) == 1 and (i[1] == u or i[1] == d):
			print(i[0], i[1])
			exit()


import sys
from math import log2
import bisect
import heapq
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

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')
INF = 10 ** 18
MOD = 10 ** 9 + 7
n = int(ri())
arr = []
for i in range(4 * n + 1):
	temp = Ri()
	arr.append(temp)
flag = False
tans = []
for i in range(0, 51):
	for j in range(i + 1, 51):
		for k in range(0, 51):
			cnt = 0
			ans = []
			(x1, x2, y1, y2) = (i, j, k, k + (j - i))
			flag = False
			for r in arr:
				(a, b) = r
				if (a == x1 or a == x2) and y1 <= b <= y2 or ((b == y1 or b == y2) and x1 <= a <= x2):
					continue
				else:
					cnt += 1
					ans = [a, b]
			if cnt == 1:
				flag = True
				tans = ans
				break
		if flag:
			break
	if flag:
		break
print(*tans)


import sys
n = int(input())
k = (n << 2) + 1
(x, y) = ([], [])
for i in range(k):
	(xi, yi) = list(map(int, input().split()))
	x.append(xi)
	y.append(yi)
for lx in range(0, 50):
	for ly in range(0, 50):
		for side_len in range(1, 51):
			(ok, idx) = (True, -1)
			for i in range(k):
				if not ((x[i] == lx or x[i] == lx + side_len) and ly <= y[i] <= ly + side_len or (lx <= x[i] <= lx + side_len and (y[i] == ly or y[i] == ly + side_len))):
					if idx != -1:
						ok = False
					else:
						idx = i
			if ok:
				print(x[idx], y[idx])
				return


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')
from collections import defaultdict
n = int(input())
dictx = defaultdict(int)
dicty = defaultdict(int)
minx = 100
maxx = -100
miny = 100
maxy = -100
coord = []
for s in range(4 * n + 1):
	(x, y) = map(int, input().split())
	dictx[x] += 1
	dicty[y] += 1
	coord.append((x, y))
for i in dictx.keys():
	if dictx[i] >= n:
		minx = min(minx, i)
		maxx = max(maxx, i)
for i in dicty.keys():
	if dicty[i] >= n:
		miny = min(miny, i)
		maxy = max(maxy, i)
faulty = (0, 0)
for i in coord:
	if i[0] == minx or i[0] == maxx:
		if miny <= i[1] <= maxy:
			continue
		else:
			faulty = i
			break
	elif minx < i[0] < maxx:
		if i[1] == miny or i[1] == maxy:
			continue
		else:
			faulty = i
			break
	else:
		faulty = i
		break
print(*faulty)


def check(index):
	point1 = points[index]
	count = 0
	for point in points:
		if point[1] == point1[1]:
			count += 1
	if count == 1:
		return False
	count = 0
	for point in points:
		if point[0] == point1[0]:
			count += 1
	if count == 1:
		return False
n = int(input())
points = []
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	points.append((x, y))
index = 0
max_x = count1 = max_y = count2 = count3 = count4 = 0
min_x = min_y = 51
for point in points:
	if point[0] > max_x:
		max_x = point[0]
	if point[0] < min_x:
		min_x = point[0]
	if point[1] > max_y:
		max_y = point[1]
	if point[1] < min_y:
		min_y = point[1]
for point in points:
	if point[0] == max_x:
		count1 += 1
	if point[0] == min_x:
		count2 += 1
	if point[1] == max_y:
		count3 += 1
	if point[1] == min_y:
		count4 += 1
if count1 == 1:
	for point in points:
		if point[0] == max_x:
			print(point[0], point[1])
			return
if count2 == 1:
	for point in points:
		if point[0] == min_x:
			print(point[0], point[1])
			return
if count3 == 1:
	for point in points:
		if point[1] == max_y:
			print(point[0], point[1])
			return
if count4 == 1:
	for point in points:
		if point[1] == min_y:
			print(point[0], point[1])
			return
for point in points:
	if point[0] != max_x and point[0] != min_x and (point[1] != max_y) and (point[1] != min_y):
		print(point[0], point[1])
		return


n = int(input())
l = []
dx = dict()
dy = dict()
for _ in range(4 * n + 1):
	(x, y) = map(int, input().split(' '))
	l.append((x, y))
	dx[x] = dx.get(x, 0) + 1
	dy[y] = dy.get(y, 0) + 1
xmin = min(dx.keys())
xmax = max(dx.keys())
ymin = min(dy.keys())
ymax = max(dy.keys())

def find(enu, f):
	for e in enu:
		if f(e):
			return e
	return None
intruder = None
if dx[xmin] == 1:
	intruder = find(l, lambda e: e[0] == xmin)
elif dx[xmax] == 1:
	intruder = find(l, lambda e: e[0] == xmax)
elif dy[ymin] == 1:
	intruder = find(l, lambda e: e[1] == ymin)
elif dy[ymax] == 1:
	intruder = find(l, lambda e: e[1] == ymax)
else:
	intruder = find(l, lambda e: e[0] > xmin and e[0] < xmax and (e[1] > ymin) and (e[1] < ymax))
(x, y) = intruder
print(x, y)


n = int(input())
minx = miny = maxx = maxy = 0
c = []
dx = {}
dy = {}
for i in range(4 * n + 1):
	(x, y) = map(int, input().split(' '))
	c.append([x, y])
	if x not in dx:
		dx[x] = 1
	else:
		dx[x] += 1
	if y not in dy:
		dy[y] = 1
	else:
		dy[y] += 1
minx = miny = maxx = maxy = 0
for i in sorted(dx.keys()):
	if dx[i] >= 2 and minx == 0:
		minx = i
		break
for i in sorted(dy.keys()):
	if dy[i] >= 2 and miny == 0:
		miny = i
		break
for i in list(reversed(sorted(dx.keys()))):
	if dx[i] >= 2 and maxx == 0:
		maxx = i
		break
for i in list(reversed(sorted(dy.keys()))):
	if dy[i] >= 2 and maxy == 0:
		maxy = i
		break
for i in c:
	if minx <= i[0] <= maxx and miny <= i[1] <= maxy:
		if (i[0] != minx and i[0] != maxx) and (i[1] != miny and i[1] != maxy):
			print(i[0], i[1])
			break
	else:
		print(i[0], i[1])
		break


from collections import Counter
n = int(input())
points = [[int(i) for i in input().split()] for _ in range(4 * n + 1)]
c_x = Counter(map(lambda a: a[0], points))
c_y = Counter(map(lambda a: a[1], points))
x = [a for a in c_x if c_x[a] >= n]
y = [a for a in c_y if c_y[a] >= n]
s_x = (min(x), max(x))
s_y = (min(y), max(y))
for p in points:
	if not (p[0] in s_x and s_y[0] <= p[1] <= s_y[1] or (p[1] in s_y and s_x[0] <= p[0] <= s_x[1])):
		print(*p)


import math
import sys, string, bisect, heapq
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : list(map(int, input().split()))
I = lambda : int(input())
n = I()
l = []
x = defaultdict(int)
y = defaultdict(int)
for i in range(4 * n + 1):
	a = L()
	l.append(a)
	x[a[0]] += 1
	y[a[1]] += 1
l.sort()
leftx = l[0][0]
if x[l[0][0]] == 1 or x[l[0][0]] > n + 2:
	keyx = l[0][0]
	leftx = l[1][0]
rightx = l[-1][0]
if x[l[-1][0]] == 1 or x[l[-1][0]] > n + 2:
	keyx = l[-1][0]
	rightx = l[-2][0]
l.sort(key=lambda x: x[1])
downy = l[0][1]
if y[l[0][1]] == 1 or y[l[0][1]] > n + 2:
	keyy = l[0][1]
	downy = l[1][1]
upy = l[-1][1]
if y[l[-1][1]] == 1 or y[l[-1][1]] > n + 2:
	upy = l[-2][1]
	keyy = l[-1][1]
c = 0
for i in l:
	if i[0] == leftx:
		if i[1] <= upy and i[1] >= downy:
			c += 1
		else:
			print(*i)
			break
	elif i[0] == rightx:
		if i[1] <= upy and i[1] >= downy:
			c += 1
		else:
			print(*i)
			break
	elif i[1] == downy:
		if i[0] >= leftx and i[0] <= rightx:
			c += 1
		else:
			print(*i)
			break
	elif i[1] == upy:
		if i[0] >= leftx and i[0] <= rightx:
			c += 1
		else:
			print(*i)
			break
	else:
		print(*i)
		break


n = int(input())
seenx = set()
seeny = set()
xs = []
ys = []
for _ in range(4 * n + 1):
	(x, y) = map(int, input().strip().split())
	seenx.add(x)
	seeny.add(y)
	xs.append(x)
	ys.append(y)
(badx, bady) = (-1, -1)
minx = min(xs)
maxx = max(xs)
if xs.count(minx) < n:
	badx = minx
	bady = ys[xs.index(minx)]
elif xs.count(maxx) < n:
	badx = maxx
	bady = ys[xs.index(maxx)]
miny = min(ys)
maxy = max(ys)
if bady == -1:
	if ys.count(miny) < n:
		bady = miny
		badx = xs[ys.index(miny)]
	elif ys.count(maxy) < n:
		bady = maxy
		badx = xs[ys.index(maxy)]
if badx == -1:
	for (i, x) in enumerate(xs):
		if x not in (minx, maxx) and ys[i] not in (miny, maxy):
			badx = x
			bady = ys[i]
			break
print(badx, bady)


from __future__ import division, print_function
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil, sqrt, log2
from copy import deepcopy
from collections import deque
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

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 testcase(t):
	for pp in range(t):
		solve(pp)

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

def power(x, y, p):
	y %= p - 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

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
inf = pow(10, 20)
mod = 10 ** 9 + 7

def solve(case):
	n = int(inp())
	points = []
	cntx = {}
	cnty = {}
	for i in range(4 * n + 1):
		(x, y) = sep()
		points.append((x, y))
		if x in cntx:
			cntx[x] += 1
		else:
			cntx[x] = 1
		if y in cnty:
			cnty[y] += 1
		else:
			cnty[y] = 1
	(max_x, max_y, min_x, min_y) = (-inf, -inf, inf, inf)
	for i in cntx:
		if cntx[i] > 1:
			max_x = max(max_x, i)
			min_x = min(min_x, i)
	for i in cnty:
		if cnty[i] > 1:
			max_y = max(max_y, i)
			min_y = min(min_y, i)
	for (i, j) in points:
		if i > max_x or i < min_x:
			print(i, j)
			return
		if i == max_x or i == min_x:
			if j > max_y or j < min_y:
				print(i, j)
				return
		elif j != max_y and j != min_y:
			print(i, j)
			return
testcase(1)


import math
n = int(input())
arr = []
for i in range(4 * n + 1):
	arr.append(list(map(int, input().split())))
for g in range(len(arr)):
	xMin = math.inf
	xMax = -1 * math.inf
	yMin = math.inf
	yMax = -1 * math.inf
	fl = True
	for i in range(4 * n + 1):
		if i != g:
			(a, b) = arr[i]
			xMin = min(xMin, a)
			xMax = max(xMax, a)
			yMin = min(b, yMin)
			yMax = max(b, yMax)
	for i in range(4 * n + 1):
		if i != g:
			if (arr[i][0] != xMax and arr[i][0] != xMin) and (arr[i][1] != yMax and arr[i][1] != yMin):
				fl = False
				break
	if fl and yMax - yMin == xMax - xMin:
		print(arr[g][0], arr[g][1])
		break


def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4):
	a1 = y2 - y1
	b1 = x1 - x2
	a2 = y4 - y3
	b2 = x3 - x4
	return not a1 * b2 - a2 * b1
n = int(input())
carr = [tuple(map(int, input().split())) for _ in range(4 * n + 1)]
xs = list(map(lambda o: o[0], carr))
ys = list(map(lambda o: o[1], carr))
(lx, rx) = (min(xs), max(xs))
(dy, uy) = (min(ys), max(ys))
for x in [lx, rx]:
	if xs.count(x) == 1:
		print(*carr[xs.index(x)])
		exit(0)
for y in [dy, uy]:
	if ys.count(y) == 1:
		print(*carr[ys.index(y)])
		exit(0)
ur = (rx, uy)
dl = (lx, dy)
for (x, y) in carr:
	lur = (x, y, *ur)
	ldl = (x, y, *dl)
	if not (is_parallel(*lur, 0, 0, 0, 1) or is_parallel(*lur, 0, 0, 1, 0) or is_parallel(*ldl, 0, 0, 0, 1) or is_parallel(*ldl, 0, 0, 1, 0)):
		print(x, y)
		break


n = int(input())
l = []
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	l.append([x, y])
lx = sorted(l)
ly = sorted(l, key=lambda x: x[1])
x0 = lx[0][0]
y0 = l[0][1]
x1 = l[-1][0]
y1 = l[-1][1]
if x0 == lx[1][0]:
	pass
else:
	x0 = lx[1][0]
if y0 == ly[1][1]:
	pass
else:
	y0 = ly[1][1]
if x1 == lx[-2][0]:
	pass
else:
	x1 = lx[-2][0]
if y1 == ly[-2][1]:
	pass
else:
	y1 = ly[-2][1]
for i in range(len(l)):
	if y0 == l[i][1] and x0 <= l[i][0] <= x1 or (x0 == l[i][0] and y0 <= l[i][1] <= y1) or (y1 == l[i][1] and x0 <= l[i][0] <= x1) or (x1 == l[i][0] and y0 <= l[i][1] <= y1):
		pass
	else:
		print(l[i][0], l[i][1])


import bisect
import functools
import math
import sys
from collections import defaultdict
rt = lambda : map(int, input().split())
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))

def solve(pts):
	for x1 in range(50):
		for x2 in range(x1 + 1, 51):
			for y1 in range(50):
				for y2 in range(y1 + 1, 51):
					wrong = []
					for i in range(len(pts)):
						(x, y) = pts[i]
						if x in (x1, x2) and y1 <= y <= y2 or (y in (y1, y2) and x1 <= x <= x2):
							pass
						else:
							wrong.append(i)
					if len(wrong) == 1:
						return pts[wrong[0]]

def main():
	n = ri()
	pts = []
	for _ in range(4 * n + 1):
		pts.append(tuple(map(int, input().split())))
	print(*solve(pts))
main()


n = int(input())
a = {}
b = {}
c = {}
d = {}
e = []
f = []
x1 = 100000
x2 = 100000
y1 = 100000
y2 = 100000
z = 0
for i in range(4 * n + 1):
	(x, y) = map(int, input().split())
	a[x] = []
	b[y] = []
	if x not in c:
		c[x] = []
		c[x] += [y]
	else:
		c[x] += [y]
	if y not in d:
		d[y] = []
		d[y] += [x]
	else:
		d[y] += [x]
for i in c:
	if c[i] != []:
		if len(c[i]) != 1:
			e += [i]
for i in d:
	if d[i] != []:
		if len(d[i]) != 1:
			f += [i]
x1 = min(e)
x2 = max(e)
y1 = min(f)
y2 = max(f)
for i in c:
	for j in c[i]:
		if i == x1 and y1 <= j <= y2 or (i == x2 and y1 <= j <= y2) or (j == y1 and x1 <= i <= x2) or (j == y2 and x1 <= i <= x2):
			continue
		else:
			print(i, j)
			z = 1
			break
	if z == 1:
		break


import sys
import math
import cProfile
DEBUG = False
if DEBUG:
	sys.stdin = open('input.txt')
	pr = cProfile.Profile()
	pr.enable()
n = sys.stdin.readline()
n = int(n)
points = []
for i in range(4 * n + 1):
	(x, y) = sys.stdin.readline().split()
	points.append((int(x), int(y)))
for i in range(4 * n + 1):
	p = points[:]
	del p[i]
	p = [{'key': _, 'value': 0} for _ in p]
	p.sort(key=lambda x: x['key'][0])
	tot1 = 0
	tot2 = 0
	for item in p:
		if item['key'][0] == p[0]['key'][0]:
			tot1 = tot1 + 1
			item['value'] = 1
		if item['key'][0] == p[-1]['key'][0]:
			tot2 = tot2 + 1
			item['value'] = 1
	if tot1 < n or tot2 < n:
		continue
	p.sort(key=lambda x: x['key'][1])
	tot1 = 0
	tot2 = 0
	for item in p:
		if item['key'][1] == p[0]['key'][1]:
			tot1 = tot1 + 1
			item['value'] = 1
		if item['key'][1] == p[-1]['key'][1]:
			tot2 = tot2 + 1
			item['value'] = 1
	if tot1 < n or tot2 < n:
		continue
	if all([_['value'] for _ in p]):
		break
print(points[i][0], points[i][1])
if DEBUG:
	pr.disable()
	pr.print_stats()


import sys
import math as m

def sort(a):
	mid = m.ceil(len(a) / 2)
	if len(a) == 1:
		return a
	else:
		al = sort(a[:mid])
		ar = sort(a[mid:])
		i = 0
		j = 0
		sa = []
		c = []
		while i < len(al) or j < len(ar):
			if i == len(al):
				sa.append(ar[j])
				j += 1
			elif j == len(ar):
				sa.append(al[i])
				i += 1
			elif al[i] > ar[j]:
				sa.append(ar[j])
				j += 1
			else:
				sa.append(al[i])
				i += 1
		return sa

def main():
	input = sys.stdin.readline()
	n = int(input)
	x = []
	y = []
	for i in range(4 * n + 1):
		input = sys.stdin.readline()
		(X, Y) = [int(j) for j in input.split()]
		x.append(X)
		y.append(Y)
	xs = sort(x)
	ys = sort(y)
	px = 0
	py = 0
	if xs[0] != xs[1]:
		X = xs[0]
	elif xs[4 * n - 1] != xs[4 * n]:
		X = xs[4 * n]
	else:
		px = 1
	if ys[0] != ys[1]:
		Y = ys[0]
	elif ys[4 * n - 1] != ys[4 * n]:
		Y = ys[4 * n]
	else:
		py = 1
	if px and (not py):
		i = 0
		while i < 4 * n + 1 and y[i] != Y:
			i += 1
		X = x[i]
	if py and (not px):
		i = 0
		while i < 4 * n + 1 and x[i] != X:
			i += 1
		Y = y[i]
	if px and py:
		i = 0
		while x[i] == min(x) or x[i] == max(x) or y[i] == min(y) or (y[i] == max(y)):
			i += 1
		(X, Y) = (x[i], y[i])
	print(X, Y)

def __starting_point():
	main()
__starting_point()


n = int(input())
points = list((tuple(map(int, input().split())) for i in range(4 * n + 1)))
xs = list(sorted(points))
ys = list(sorted(points, key=lambda x: (x[1], x[0])))
xsize = xs[-1][0] - xs[0][0]
ysize = ys[-1][1] - ys[0][1]

def check(point):
	p1 = xs[-1][0] if xs[-1] != point else xs[-2][0]
	p2 = xs[0][0] if xs[0] != point else xs[1][0]
	p3 = ys[-1][1] if ys[-1] != point else ys[-2][1]
	p4 = ys[0][1] if ys[0] != point else ys[1][1]
	return p1 - p2 == p3 - p4
if xsize == ysize:
	for p in points:
		if p[0] != xs[0][0] and p[0] != xs[-1][0] and (p[1] != ys[-1][1]) and (p[1] != ys[0][1]):
			print(p[0], p[1])
elif check(xs[-1]):
	print(xs[-1][0], xs[-1][1])
elif check(xs[0]):
	print(xs[0][0], xs[0][1])
elif check(ys[-1]):
	print(ys[-1][0], ys[-1][1])
elif check(ys[0]):
	print(ys[0][0], ys[0][1])


N = int(input())
x_freq = {}
y_freq = {}
data = []
for i in range(4 * N + 1):
	arr = input()
	(x, y) = [int(x) for x in arr.split(' ')]
	data.append([x, y])
	if x not in x_freq:
		x_freq[x] = 1
	else:
		x_freq[x] += 1
	if y not in y_freq:
		y_freq[y] = 1
	else:
		y_freq[y] += 1
x_inteval = []
y_inteval = []
for num in x_freq:
	if x_freq[num] >= N:
		x_inteval.append(num)
for num in y_freq:
	if y_freq[num] >= N:
		y_inteval.append(num)
x_inteval = [min(x_inteval), max(x_inteval)]
y_inteval = [min(y_inteval), max(y_inteval)]
for p in data:
	if p[0] not in x_inteval and p[1] not in y_inteval:
		print(p[0], p[1])
		quit()
	elif p[0] < x_inteval[0] or p[0] > x_inteval[1]:
		print(p[0], p[1])
		quit()
	elif p[1] < y_inteval[0] or p[1] > y_inteval[1]:
		print(p[0], p[1])
		quit()