n = int(input())
adlist = [input().split()for i in range(n)] #輸入攻防二維
adlist = [list(map(int, object)) for object in adlist] #轉整數
abilitylist = []
for j in range(n):
a = adlist[j][0]** 2 + adlist[j][1] ** 2 #算能力值
abilitylist.append(a) #輸入list
abilitylist.sort() #排序
second = abilitylist[-2] #找能力值第二
for x in range(len(adlist)):
if adlist[x][0]** 2 + adlist[x][1] ** 2 == second: #回去判斷誰是能力值第二
print(*adlist[x]) #星號直接輸出角色攻防值陣列中的數字
else:
continue