class Vector
    def initialize
        @a = []
    end

    def pushBack(x)
        @a.push(x)
#        p @a
    end

    def randomAccess(x)
        puts @a[x]
    end

    def popBack
        @a.pop
    end
end

vector = Vector.new
num = gets.to_i

num.times do
    ope, x = gets.split.map(&:to_i)
    case ope
    when 0
        vector.pushBack(x)
    when 1
        vector.randomAccess(x)
    when 2
        vector.popBack
    end
end
