#include<stdio.h>
struct ListNode
{
int key;
struct ListNode *next;
};
void returnback(struct ListNode *head,int k){
struct ListNode *p;
int i=1;
p=head->next;
while(p)
{
p=p->next;
if(i>=k)
{
head=head->next;
}
i++;
}
if(k>i||k==0)
printf("%d\n",NULL);
else
printf("%d\n",head->key);
}
int main(){
int n,val,k;
while(scanf("%d",&n)!=EOF)
{
struct ListNode *p=(struct ListNode*)malloc(sizeof(struct ListNode));
struct ListNode *head=(struct ListNode*)malloc(sizeof(struct ListNode));
p->next=NULL;
head=p;
for(int i=0;i<n;i++)
{
struct ListNode *q=(struct ListNode*)malloc(sizeof(struct ListNode));
q->next=NULL;
scanf("%d",&val);
q->key=val;
p->next=q;
p=q;
}
scanf("%d",&k);
returnback(head,k);
}
return 0;
}