arr = []
q = gets.to_i
q.times{
    query = gets.chomp.split.map(&:to_i)
    case query[0]
    when 0
        arr.push query[1]
    when 1
        puts arr[query[1]]
    when 2
        arr.pop
    end
}
