A = []
q = gets.chomp.to_i
q.times{
    input = gets.chomp
    query = input.split(" ")
    case query[0]
    when "0"
        A.push(query[1])
    when "1"
        puts A[query[1].to_i]
    when "2"
        A.pop()
    else
    end
}
