#include<bits/stdc++.h>
using namespace std;
int main() {
    vector<int> v;
    int T;
    cin >> T;
    while (T--) {
        int t;
        cin >> t;
        if (t==0) {int x;cin >> x;v.push_back(x);}
        if (t==1) {int x;cin >> x;printf("%d\n", v[x]);}
        if (t==2) {v.pop_back();}
    }
    return 0;
}
