#include<iostream>

using namespace std;

struct ListNode
{
    int m_nKey;
    ListNode* m_pNext;
};

int main(){
    int n;
    while(cin>>n){
        auto head = new ListNode;
        cin>>head->m_nKey;

        auto cur = head;

        for(int i = 0; i < n - 1; i++){
            auto node = new ListNode;
            cin>>node->m_nKey;
            cur->m_pNext = node;
            cur = cur->m_pNext;
        }
        cur->m_pNext = NULL;

        int pos;
        cin>>pos;

        auto pre = head, after = head;
        for(int i = 1; i < pos; i++){
            after= after->m_pNext;
        }
        while(after->m_pNext != NULL){
            pre = pre->m_pNext;
            after = after->m_pNext;
        }
        cout<<pre->m_nKey<<endl;
    }
    return 0;
    
    
}