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

int main(){

    int q;
    cin >> q;

    vector<int> vec;
    for(int i = 0; i < q; ++i){
        int com, num;;
        cin >> com;
        if(com == 0){
            cin >> num;
            vec.push_back(num);
        }
        else if(com == 1){
            cin >> num;
            cout << vec[num] << endl;
        }
        else if(com == 2){
            vec.pop_back();
        }
    }

    return 0;
}
