#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int>res;
unsigned int n;
cin>>n;
int k;
while(cin>>k&&k>=0)//注意输入为负数就停止,而不是-1;
{
res.push_back(k);
}
int count=res.size();
if(n<=count)
cout<<res[count-n];//直接索引查找就行了,时间复杂度为常数。
else cout<<"NULL";
return 0;
}