# 20240622 while True: try: n = int(input()) ls = list(map(int,input().split())) k = int(input()) print(ls[n-k]) except: break