while True:
    try:
        n=int(input())
        s=input().split(' ')
        k=int(input())
        if k!=0:#擦,要先判断k是否为0,因为没有倒数第0个结点
            print(s[n-k])
        else:
            print(0)
            
    except:
        break