# -*- coding: utf-8 -*-

# kakomon toku

import math

import sys

import itertools

import numpy as np



n = int(eval(input()))

a = [int(i) for i in input().split()]



#print(a)

ai=0

for m in a:

    if ai < m:

        ai = m

a = np.sort(a)

aj = a[0]

center = ai / 2

diff = ai

i=0

for m in a:

    if diff > abs(m - center) :

        aj = m

        diff = abs(aj - center)

    else:

        break



print((ai,aj))

# -*- coding: utf-8 -*-

# kakomon toku

import math

import sys

import itertools

import numpy as np



n = int(eval(input()))

a = [int(i) for i in input().split()]



#print(a)

a = np.sort(a)

ai = a[n-1]

aj = a[0]

center = ai / 2

diff = ai

i=0

for m in a:

    if diff > abs(m - center) :

        aj = m

        diff = abs(aj - center)

    else:

        break



print((ai,aj))

# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

n = int(eval(input()))
a = [int(i) for i in input().split()]
# print(a)
ai = 0
for m in a:
    if ai < m:
        ai = m
a = np.sort(a)
aj = a[0]
center = ai / 2
diff = ai
i = 0
for m in a:
    if diff > abs(m - center):
        aj = m
        diff = abs(aj - center)
    else:
        break
print((ai, aj))

# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

n = int(eval(input()))
a = [int(i) for i in input().split()]
# print(a)
a = np.sort(a)
ai = a[n - 1]
aj = a[0]
center = ai / 2
diff = ai
i = 0
for m in a:
    if diff > abs(m - center):
        aj = m
        diff = abs(aj - center)
    else:
        break
print((ai, aj))

-ai = 0 -for m in a: -    if ai < m: -        ai = m +ai = a[n - 1]