#include<iostream> using namespace std; struct ListNode{ int m_nKey; ListNode* m_pNext; ListNode(int x):m_nKey(x),m_pNext(nullptr){} }; int res(ListNode * head,int N,int k){ if(k<1 || k>N+1) return NULL; ListNode * node = head; int t=1; while(t<=N-k){ node=node->m_pNext; t++; } return node->m_nKey; } int main(){ int N,n,k,temp; while(cin>>N){ n=N; cin>>temp; ListNode * root = new ListNode(temp); ListNode * node=root; n--; while(n--){ cin>>temp; ListNode * newNode = new ListNode(temp); node->m_pNext=newNode; node=node->m_pNext; } cin>>k; cout<<res(root,N,k)<<endl; } return 0; }