while True: try: count = int(input()) link = input().split() k = int(input()) print(link[-k]) except: break