#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node* next;
}Node,*LNode;

int main(){
    int n,k,val;
    while(scanf("%d",&n)!=EOF){
        LNode s,L;
        int i;
        L=(LNode)malloc(sizeof(Node));
        L->next=NULL;
        for(i=0;i<n;i++){
            s=(LNode)malloc(sizeof(Node));
            scanf("%d ",&val);
            s->data=val;
            s->next=L->next;
            L->next=s;
        }
        i=0;
        scanf("%d",&k);
        if(k<=0||k>n)
            printf("%d\n",k=i);
        else{
            for(i=0;i<k;i++)
            {
                L=L->next;
            }
            printf("%d\n",L->data);
        }
    }
    return 0;
}