#include <stdio.h> typedef struct listnode { int key; struct listnode* next; }listnode; int main() { int n=0; while(scanf("%d",&n)==1) { listnode *num; listnode *head; listnode *tail; head=(listnode*)malloc(sizeof(listnode)); head->next=NULL; tail=head; for(int i=0;i<n;i++) { num=(listnode*)malloc(sizeof(listnode)); scanf("%d",&num->key); num->next=NULL; tail->next=num; tail=num; } head=head->next; int search=0; scanf("%d",&search); if(search>=0||search<n) { listnode *find; find=head; for(int i=0;i<n-search;i++) find=find->next; printf("%d\n",find->key); } } return 0; }