Sereja has got an array, consisting of *n* integers, *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. Sereja is an active boy, so he is now going to complete *m* operations. Each operation will have one of the three forms:
 1.  Make *v*<sub class="lower-index">*i*</sub>-th array element equal to *x*<sub class="lower-index">*i*</sub>. In other words, perform the assignment *a*<sub class="lower-index">*v*<sub class="lower-index">*i*</sub></sub> = *x*<sub class="lower-index">*i*</sub>. 1.  Increase each array element by *y*<sub class="lower-index">*i*</sub>. In other words, perform *n* assignments *a*<sub class="lower-index">*i*</sub> = *a*<sub class="lower-index">*i*</sub> + *y*<sub class="lower-index">*i*</sub> (1 ≤ *i* ≤ *n*). 1.  Take a piece of paper and write out the *q*<sub class="lower-index">*i*</sub>-th array element. That is, the element *a*<sub class="lower-index">*q*<sub class="lower-index">*i*</sub></sub>. 
Help Sereja, complete all his operations.
The first line contains integers *n*, *m* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the original array.

Next *m* lines describe operations, the *i*-th line describes the *i*-th operation. The first number in the *i*-th line is integer *t*<sub class="lower-index">*i*</sub> (1 ≤ *t*<sub class="lower-index">*i*</sub> ≤ 3) that represents the operation type. If *t*<sub class="lower-index">*i*</sub> = 1, then it is followed by two integers *v*<sub class="lower-index">*i*</sub> and *x*<sub class="lower-index">*i*</sub>, (1 ≤ *v*<sub class="lower-index">*i*</sub> ≤ *n*, 1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>). If *t*<sub class="lower-index">*i*</sub> = 2, then it is followed by integer *y*<sub class="lower-index">*i*</sub> (1 ≤ *y*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">4</sup>). And if *t*<sub class="lower-index">*i*</sub> = 3, then it is followed by integer *q*<sub class="lower-index">*i*</sub> (1 ≤ *q*<sub class="lower-index">*i*</sub> ≤ *n*).
array_operations = input().split()

array = [int(x) for x in input().split()]
#operations = []
counter = 0
NotSum = []
for operation in range(int(array_operations[1])):
    #operations.append(input().split())
    operation = input().split()
    if operation[0] == '1':
        if (int(operation[1]) - 1) not in NotSum: # o valor vai ser atualizado!
            #counter -= array[int(operation[1]) - 1]
            NotSum.append(int(operation[1])-1)  # guarda o index do elemento que n pode ser somado com o counter
        array[int(operation[1]) - 1] = int(operation[2])
    elif operation[0] == '2':
        #array = array[int(operation[1]) - 1:int(operation[2])]
        counter += int(operation[1])
    elif operation[0] == '3':
        if (int(operation[1]) - 1) not in NotSum:
            print(array[int(operation[1]) - 1])          
        else:
            print(array[int(operation[1]) - 1] + counter)



# for operation in operations:
#     if operation[0] == '1':
#         array[int(operation[1]) - 1] = int(operation[2])
#     elif operation[0] == '2':
#         array = array[int(operation[1]) - 1:int(operation[2])]
#         print(sum(array))
#     elif operation[0] == '3':
#         print(array[int(operation[1]) - 1])


# counter = 0
# valorAnterior = 0
# position= -1
# auxiliar = 0
# aux = []
# for i in range(int(array_operations[1])):
#     operation = input().split()
#     if operation[0] == '1':

#         position = int(operation[1]) -1
#         if position not in aux:
#             aux.append(position)
#         array[int(operation[1]) - 1] = int(operation[2])
#         counter -= auxiliar
#         #print(array)
#     elif operation[0] == '2':
#         auxiliar = int(operation[1])
#         valorAnterior += int(operation[1])
#         counter += int(operation[1])
#         # sum(array[int(operation[1]) - 1:int(operation[2])])
#     elif operation[0] == '3':
#       if (int(operation[1])-1) in aux:
#         print(array[int(operation[1])-1] + counter)
#       else:
#         print(array[int(operation[1])-1] + valorAnterior)
      
        
# # c=0
# # func = lambda x : c+=1 if x  else None
# # s = input().replace('0', ' ').split()
# # print(s)
