N,M = map(int,input().split()) a = list(map(int,input().split())) n = 1 while n < M: n <<= 1 dat = [[0] * 2 for _ in range(2 * n - 1)] for i in range(M): j = i + n - 1 #dat[j] = [a[i],i + 1] dat[j][0] = a[i] dat[j][1] = i + 1 def add(i,x): j = i - 1 + n - 1 dat[j][0] += x while j >= 0: j = (j - 1) // 2 k1 = j * 2 + 1 k2 = j * 2 + 2 if dat[k1][0] <= dat[k2][0]: dat[j][0] = dat[k2][0] dat[j][1] = dat[k2][1] else: dat[j][0] = dat[k1][0] dat[j][1] = dat[k1][1] def make(): for i in reversed(range(n-1)): k1 = i * 2 + 1 k2 = i * 2 + 2 if dat[k1][0] <= dat[k2][0]: k = k2 else: k = k1 dat[i][0] = dat[k][0] dat[i][1] = dat[k][1] def get(): return dat[0][1] make() Q = int(input()) for _ in range(Q): t,x,y = map(int,input().split()) if t == 1: add(x,y) elif t == 2: add(x,-y) else: print(get())