#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio( false );

	int q;
	cin >> q;
	vector<int> a;

	for( int i = 0; i < q; ++i ) {
		int c, x;
		cin >> c;

		if( c == 0 ) {
			cin >> x;
			a.push_back( x );
		}
		else if( c == 1 ) {
			cin >> x;
			cout << a.at( x ) << '\n';
		}
		else if( c == 2 ) {
			a.pop_back();
		}
	}
}
