while True:
    try:
        N = int(input())
        s = input().split()
        x = int(input())
        print(s[-x] if x != 0 else 0)
    except:
        break


# N = int(input())
# s = input().split()
# x= int(input())
# print(s[-x])