import sys
input = sys.stdin.readline
N, K = map(int, input().split())
lst = list(map(int, input().split()))
ans = -1
for last in range(N-1, 0, -1):
i = lst.index(max(lst[:last+1]))
if last != i:
lst[last], lst[i] = lst[i], lst[last]
K -= 1
if K == 0:
ans = f'{lst[i]} {lst[last]}'
break
print(ans)