n = int(eval(input()))

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

a.sort()

M = max(a)

m = M / 2



diff = 10 ** 9

r = None

for i in range(n):

    if a[i] == M:

        continue

    else:

        if abs(m - a[i]) < diff:

            diff = abs(m - a[i])

            r = a[i]



print((M, r))

import sys

from bisect import bisect_left



sys.setrecursionlimit(10 ** 6)

INF = float("inf")

MOD = 10 ** 9 + 7





def input():

    return sys.stdin.readline().strip()





def main():

    N = int(eval(input()))

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

    A.sort()

    MAX = max(A)

    A = A[:-1]

    target = MAX / 2

    idx = bisect_left(A, target)



    if idx == 0:

        print((MAX, A[0]))

    elif idx == N - 1:

        print((MAX, A[-1]))

    else:

        if abs(target - A[idx]) < abs(target - A[idx - 1]):

            print((MAX, A[idx]))

        else:

            print((MAX, A[idx - 1]))





if __name__ == "__main__":

    main()

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
M = max(a)
m = M / 2
diff = 10**9
r = None
for i in range(n):
    if a[i] == M:
        continue
    else:
        if abs(m - a[i]) < diff:
            diff = abs(m - a[i])
            r = a[i]
print((M, r))

import sys
from bisect import bisect_left

sys.setrecursionlimit(10**6)
INF = float("inf")
MOD = 10**9 + 7


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


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort()
    MAX = max(A)
    A = A[:-1]
    target = MAX / 2
    idx = bisect_left(A, target)
    if idx == 0:
        print((MAX, A[0]))
    elif idx == N - 1:
        print((MAX, A[-1]))
    else:
        if abs(target - A[idx]) < abs(target - A[idx - 1]):
            print((MAX, A[idx]))
        else:
            print((MAX, A[idx - 1]))


if __name__ == "__main__":
    main()

-n = int(eval(input())) -a = list(map(int, input().split())) -a.sort() -M = max(a) -m = M / 2 -diff = 10**9 -r = None -for i in range(n): -    if a[i] == M: -        continue +import sys +from bisect import bisect_left + +sys.setrecursionlimit(10**6) +INF = float("inf") +MOD = 10**9 + 7 + + +def input(): +    return sys.stdin.readline().strip() + + +def main(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    A.sort() +    MAX = max(A) +    A = A[:-1] +    target = MAX / 2 +    idx = bisect_left(A, target) +    if idx == 0: +        print((MAX, A[0])) +    elif idx == N - 1: +        print((MAX, A[-1])) -        if abs(m - a[i]) < diff: -            diff = abs(m - a[i]) -            r = a[i] -print((M, r)) +        if abs(target - A[idx]) < abs(target - A[idx - 1]): +            print((MAX, A[idx])) +        else: +            print((MAX, A[idx - 1])) + + +if __name__ == "__main__": +    main()