N = int(input())
A = list(map(int, input().split()))
Q = int(input())
query = [input().split() for _ in range(Q)]

for q in query:
    if q[0] == "1":
        _, k, x = q
        A[int(k) - 1] = int(x)
    elif q[0] == "2":
        _, k = q
        print(A[int(k) - 1])
