import sys

import math

def input():

    return sys.stdin.readline()[:-1]

n=int(eval(input()))

a=list(map(int,input().split()))

a.sort()

half=float(a[-1])/2

len=float("inf")

ans=a[0]

for i in range(n-1):

    if len>abs(half-a[i]):

        ans=a[i]

        len=abs(half-a[i])

print((a[-1]))

print(ans)
import bisect, copy, heapq, math, sys

from collections import *

from functools import lru_cache

from itertools import accumulate, combinations, permutations, product

def input():

    return sys.stdin.readline()[:-1]

def ruiseki(lst):

    return [0]+list(accumulate(lst))

def celi(a,b):

    return -(-a//b)

sys.setrecursionlimit(5000000)

mod=pow(10,9)+7

al=[chr(ord('a') + i) for i in range(26)]

direction=[[1,0],[0,1],[-1,0],[0,-1]]



n=int(eval(input()))

a=list(map(int,input().split()))



a.sort(reverse=True)

ans=a[1]

for i in range(n-1):

    if min(a[0]-a[i+1],a[i+1])>min(a[0]-ans,ans):

        ans=a[i+1]

    # print(ans)

print((a[0],ans))
import sys
import math


def input():
    return sys.stdin.readline()[:-1]


n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
half = float(a[-1]) / 2
len = float("inf")
ans = a[0]
for i in range(n - 1):
    if len > abs(half - a[i]):
        ans = a[i]
        len = abs(half - a[i])
print((a[-1]))
print(ans)

import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product


def input():
    return sys.stdin.readline()[:-1]


def ruiseki(lst):
    return [0] + list(accumulate(lst))


def celi(a, b):
    return -(-a // b)


sys.setrecursionlimit(5000000)
mod = pow(10, 9) + 7
al = [chr(ord("a") + i) for i in range(26)]
direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[1]
for i in range(n - 1):
    if min(a[0] - a[i + 1], a[i + 1]) > min(a[0] - ans, ans):
        ans = a[i + 1]
    # print(ans)
print((a[0], ans))

-import sys -import math +import bisect, copy, heapq, math, sys +from collections import * +from functools import lru_cache +from itertools import accumulate, combinations, permutations, product +def ruiseki(lst): +    return [0] + list(accumulate(lst)) + + +def celi(a, b): +    return -(-a // b) + + +sys.setrecursionlimit(5000000) +mod = pow(10, 9) + 7 +al = [chr(ord("a") + i) for i in range(26)] +direction = [[1, 0], [0, 1], [-1, 0], [0, -1]] -a.sort() -half = float(a[-1]) / 2 -len = float("inf") -ans = a[0] +a.sort(reverse=True) +ans = a[1] -    if len > abs(half - a[i]): -        ans = a[i] -        len = abs(half - a[i]) -print((a[-1])) -print(ans) +    if min(a[0] - a[i + 1], a[i + 1]) > min(a[0] - ans, ans): +        ans = a[i + 1] +    # print(ans) +print((a[0], ans))