#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	vector<int> A;
	int q;
	int query;
	int x;

	cin >> q;

	for (int i = 0; i < q; i++) {
		cin >> query;
		if (query == 0) {
			cin >> x;
			A.push_back(x);
		}
		else if (query == 1) {
			cin >> x;
			cout << A[x] << endl;
		}
		else {
			A.pop_back();
		}	
	}
}


