class Node:
    def __init__(self, val):
        self.val = val
        self.next = None


while True:
    try:
        nums, values, k = int(input()), list(map(int, input().split())), int(input())
        if k == 0:
            print(0)
        else:
            head = Node(values[0])
            cur = head
            for value in values[1:]:
                cur.next = Node(value)
                cur = cur.next
            fast = head
            slow = head
            for i in range(0, k):
                fast = fast.next
            while fast:
                fast = fast.next
                slow = slow.next
            print(slow.val)
    except:
        break