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$.

Difficulty: interview

Starter code:

Solutions:
#!/usr/bin/env python
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


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



N = int(input())

#N,B = [int(x) for x in arr.split(' ')]

#arr = input()
#A = [int(x) for x in arr.split(' ')]

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)]
#print(x_inteval,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()


n = int(input())

l = []
dx = dict()
dy = dict()

for _ in range(4 * n + 1):
    x, y = list(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)


# -*- coding: utf-8 -*-
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)
# template


def main():
    n = ii()
    a = [tuple(mi()) for i in range(4 * n + 1)]
    # print(a)
    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(x, y, m)
                    print(ans[0][0], ans[0][1])
                    return


def __starting_point():
    main()

__starting_point()

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]))
    return
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]))
    return
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]))
    return
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]))
    return
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]))
        return



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())
def check(l):
    a = b = float('inf') # max points
    c = d = 0 # min points
    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])
        return

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
    else:
        if(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())
f = []
X = []
Y = []
for i in range(4 * n + 1):
    x, y = list(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])
            return
    for i in f:
        if l < i[0] < r and d < i[1] < u:
            print(i[0], i[1])
            return
else:
    for i in f:
        if X.count(i[0]) == 1 and Y.count(i[1]) == 1:
            print(i[0], i[1])
            return
    for i in f:
        if X.count(i[0]) == 1 and (i[0] == l or i[0] == r):
            print(i[0], i[1])
            return
        elif Y.count(i[1]) == 1 and (i[1] == u or i[1] == d):
            print(i[0], i[1])
            return


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
#print(x1,x2,y1,y2)
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
    else:
        if(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
        
    


#!/usr/bin/env python

n = int(input())

seenx = set()
seeny = set()
xs = []
ys = []

for _ in range(4*n + 1):
    x, y = list(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: #the point is inside the square
    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 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)

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 = list(map(int, input().split()))
	p.append((x, y))
ans = sol(p)
print(*p[ans])


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
    
    # print(x_max, y_max), (x_min, y_min)
    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())

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])
else:
    if 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])


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)


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

# cook your dish here
n=int(input())
minx=miny=maxx=maxy=0
c=[]
dx={}
dy={}
for i in range(4*n+1):
    x,y=list(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
        
    


# https://codeforces.com/contest/1184/problem/C1
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 = list(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  
#print(min_x, max_x), (min_y, max_y)   

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]))        
#2
#0 0
#0 1
#0 2
#1 0
#1 1
#1 2
#2 0
#2 1
#2 2


def find_inside_point(points, maxx, minx, maxy, miny):
    # print('inside point')
    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):
    # print('outside point')
    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)

    # count = sum([ 1 for x, y in points if minx < x < maxx and miny < y < maxy])
    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() ]
        # print(x, y)
        points.append((x, y))

    process(n, points)
__starting_point()