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*).
# import sys
# sys.stdout = open('New cp/output.txt', 'w')
# sys.stdin = open('New cp/input.txt', 'r')
 
# from typing import Counter
 
# a=int(input()) #This is for interger as input 
# a,b,c=map(int,input().split()) #This is for 3 interger as input on same line
# a=list(map(int,input().split())) #list as input
# a=int(input()) #string as input
# Dict={"2":"is","1":"This","4":"sentence","3":"a"}
# # sorted_dict=dict(sorted(Dict.items(),targetey=lambda x: int(x[0]))) sorts dictionary by targetey


n,m=map(int,input().split())
arr=list(map(int,input().split()))
for i in range(m):
    a = list(map(int,input().split()))
    if len(a)==2:
        t=a[0]
        if t==3:
            q=a[1]
        elif t==2:
            y=a[1] 
    elif len(a)==3:
        t,v,x=a

    if t==1:
        # v,x=map(int,input().split())
        if v==0:
            arr[0]=x
        else:
            arr[v-1]=x

    elif t==2:
        # y=int(input())
        for i in range(0,len(arr)):
            arr[i]=arr[i]+y
    elif t==3:
        # q=int(input())
        if q==0:
            print(arr[0])
        else:
            print(arr[q-1])






 
# def solve(arr):
#     return 
    


# print(solve(arr))





























# class LinkedList:
#     def __init__(self,data):
#         self.data= data
#         self.next= None
# def length(head):

#     count=0
#     while head is not None:
#         count+=1
#         head=head.next
#     return count    

# def print_ll(head):
#     while head is not None:
#         print(head.data,end=" ")
#         head=head.next   



  


   

   
    
        
# def takeinput():
    
#     inputlist=[int(ele) for ele in input().split()]
#     head=None
#     tail=None
#     for curr_data in inputlist:
#         if curr_data==-1:
#             break
#         newnode=LinkedList(curr_data)
#         if head is None:
#             head=newnode
#             tail=newnode
#         else:
#             tail.next=newnode
#             tail=tail.next
            
#     return head

# head=takeinput()


   










 
 
 
 