#include <iostream>
#include <vector>
using namespace std;

int main()
{
	vector<int> a;
	int q;

	cin >> q;

	for (int i = 0; i < q; i++) {
		int t;
		cin >> t;

		if (t == 0) {
			int x;
			cin >> x;
			a.push_back(x);
		}
		else if (t == 1) {
			int p;
			cin >> p;
			cout << a[p] << endl;
		}
		else if (t == 2) {
			a.pop_back();
		}
	}

	return 0;
}
