import sys
while True:
    try:
        N = int(input())
        L = list(map(int, input().split()))
        I = int(input())
        if I <= 0 or I > N:
            print(0)#空指针输出0
        else:
            print(L[-I])
    except:
#         print(sys.exc_info())
        break