def func():
    n = int(input())
    numlist = list(map(int, input().split()))
    k = int(input())

    print(numlist[-k])   # 机试的时候这么做

try:
    while True:
        func()
except EOFError:
    pass