import sys while True: try: n = int(input()) list1 = sys.stdin.readline().strip().split() k = int(input()) print(list1[-k]) except EOFError: break