__author__ = 'Igor Sorokin'
__email__ = 'igor.sorokin66@gmail.com'
__status__ = 'Completed'
'''
Problem Statement:
https://www.hackerrank.com/challenges/closest-numbers
'''
waste = input()
arr = [int(i) for i in input().split()]
sarr = sorted(arr)

dicto = {}
for i in range(1, len(sarr)):
    val = sarr[i] - sarr[i-1]
    if val in dicto:
        dicto[val].append(sarr[i-1])
        dicto[val].append(sarr[i])
    else:
        dicto[val] = [sarr[i-1], sarr[i]]
print(*dicto[min(dicto)], sep=" ")
5b62981af28d7d4db186ec0ef613cf9f5351f7bc
<mask token>

<mask token>
for i in range(1, len(sarr)):
    val = sarr[i] - sarr[i - 1]
    if val in dicto:
        dicto[val].append(sarr[i - 1])
        dicto[val].append(sarr[i])
    else:
        dicto[val] = [sarr[i - 1], sarr[i]]
print(*dicto[min(dicto)], sep=' ')

__author__ = 'Igor Sorokin'
__email__ = 'igor.sorokin66@gmail.com'
__status__ = 'Completed'
<mask token>
waste = input()
arr = [int(i) for i in input().split()]
sarr = sorted(arr)
dicto = {}
for i in range(1, len(sarr)):
    val = sarr[i] - sarr[i - 1]
    if val in dicto:
        dicto[val].append(sarr[i - 1])
        dicto[val].append(sarr[i])
    else:
        dicto[val] = [sarr[i - 1], sarr[i]]
print(*dicto[min(dicto)], sep=' ')

__author__ = 'Igor Sorokin'
__email__ = 'igor.sorokin66@gmail.com'
__status__ = 'Completed'
'''
Problem Statement:
https://www.hackerrank.com/challenges/closest-numbers
'''
waste = input()
arr = [int(i) for i in input().split()]
sarr = sorted(arr)

dicto = {}
for i in range(1, len(sarr)):
    val = sarr[i] - sarr[i-1]
    if val in dicto:
        dicto[val].append(sarr[i-1])
        dicto[val].append(sarr[i])
    else:
        dicto[val] = [sarr[i-1], sarr[i]]
print(*dicto[min(dicto)], sep=" ")