# ABC094D - Binomial Coefficients (ARC095D)

from bisect import bisect_left as bs





def main():

    # pascal's triangle := mid area (nCn/2) is the biggest -> bisect

    N = int(eval(input()))

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

    if N == 2:

        print((A[1], A[0]))

        return

    n, idx = A[-1], bs(A[:-1], A[-1] // 2)

    cand = [(abs(A[i] - n / 2), A[i]) for i in (idx - 1, idx, idx + 1)]

    r = min(cand)[1]

    print((n, r))





if __name__ == "__main__":

    main()
# ABC094D - Binomial Coefficients (ARC095D)

def main():

    # pascal's triangle := mid area (nCn/2) is the biggest

    N = int(eval(input()))

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

    n = max(A)

    mid, r, dif = n / 2, -1, float("inf")

    for i in A:

        if i != n:

            x = abs(mid - i)

            if x < dif:

                r, dif = i, x

    print((n, r))





if __name__ == "__main__":

    main()
# ABC094D - Binomial Coefficients (ARC095D)
from bisect import bisect_left as bs


def main():
    # pascal's triangle := mid area (nCn/2) is the biggest -> bisect
    N = int(eval(input()))
    A = sorted(map(int, input().split()))
    if N == 2:
        print((A[1], A[0]))
        return
    n, idx = A[-1], bs(A[:-1], A[-1] // 2)
    cand = [(abs(A[i] - n / 2), A[i]) for i in (idx - 1, idx, idx + 1)]
    r = min(cand)[1]
    print((n, r))


if __name__ == "__main__":
    main()

# ABC094D - Binomial Coefficients (ARC095D)
def main():
    # pascal's triangle := mid area (nCn/2) is the biggest
    N = int(eval(input()))
    A = tuple(map(int, input().split()))
    n = max(A)
    mid, r, dif = n / 2, -1, float("inf")
    for i in A:
        if i != n:
            x = abs(mid - i)
            if x < dif:
                r, dif = i, x
    print((n, r))


if __name__ == "__main__":
    main()

-from bisect import bisect_left as bs - - -    # pascal's triangle := mid area (nCn/2) is the biggest -> bisect +    # pascal's triangle := mid area (nCn/2) is the biggest -    A = sorted(map(int, input().split())) -    if N == 2: -        print((A[1], A[0])) -        return -    n, idx = A[-1], bs(A[:-1], A[-1] // 2) -    cand = [(abs(A[i] - n / 2), A[i]) for i in (idx - 1, idx, idx + 1)] -    r = min(cand)[1] +    A = tuple(map(int, input().split())) +    n = max(A) +    mid, r, dif = n / 2, -1, float("inf") +    for i in A: +        if i != n: +            x = abs(mid - i) +            if x < dif: +                r, dif = i, x