#利用列表的负数下标直接输出
while True:
    try:
        a=input()
        b=input().split()
        c=int(input())
        print(b[-c])
    except:
        break