#include<iostream>
#include<vector>
using namespace std;
vector<int> a;
int main()
{
	int p,q,opt,x;
	cin >> q;
	while (q--)
	{
		cin >> opt;
		if (opt == 0){ cin >> x; a.push_back(x); }
		if (opt == 1){ cin >> p; cout << a[p] << endl; }
		if (opt == 2) a.pop_back();
	}
	return 0;
}
