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

int main(){
    vector<int> a;
    int q;
    cin>>q;
    while(q--){
        int y,x;
        cin>>y;
        switch(y){
            case 0:cin>>x;a.push_back(x);break;
            case 1:cin>>x;cout<<a[x]<<endl;break;
            case 2:a.pop_back();break;
        }
    }
    return 0;
}
