# 20240919 while True: try: n = int(input()) ls = input().split() k = int(input()) if k != 0: print(ls[-k]) else: print(0) except: break