import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    int q = readint;

    int[] v;
    for (int i = 0; i < q; i++) {
        auto xs = readints;

        switch (xs[0]) {
            case 0: v ~= xs[1]; break;
            case 1: writeln(v[xs[1]]); break;
            case 2: v = v[0..$ - 1]; break;
            default: break;
        }
    }
}

