地址:http://acm.swust.edu.cn/problem/1044/
#include<stdio.h>
int main(){
int N;
while(scanf("%d",&N)!=EOF)
{
int arr[1000];
int top,i;
for(top=0;top<N;top++)
{
scanf("%d",&arr[top]);
}
top-=1;
int k;
scanf("%d",&k);
for(i=0;i<k;i++)
{
top--;
}
if(top<0)
printf("-1");
else
printf("%d",arr[top]);
}
return 0;
}