import sys input = sys.stdin.readline from collections import Counter N,Q,L=map(int,input().split()) A=list(map(int,input().split())) seg_el=1<<((2000000).bit_length()) # Segment treeの台の要素数 SEG=[0]*(2*seg_el) # 1-indexedなので、要素数2*seg_el.Segment treeの初期値で初期化 SEG2=[0]*(2*seg_el) # 1-indexedなので、要素数2*seg_el.Segment treeの初期値で初期化 def seg_function(x,y): # Segment treeで扱うfunction return x+y C=Counter(A) for c in C: SEG[c+seg_el]=C[c] SEG2[c+seg_el]=C[c]*c for i in range(seg_el-1,0,-1): # 親の部分もupdate SEG[i]=seg_function(SEG[i*2],SEG[i*2+1]) SEG2[i]=seg_function(SEG2[i*2],SEG2[i*2+1]) def update(n,x,seg_el): # A[n]をxへ更新 i=n+seg_el SEG[i]+=1 SEG2[i]+=x i>>=1 # 子ノードへ while i!=0: SEG[i]=seg_function(SEG[i*2],SEG[i*2+1]) SEG2[i]=seg_function(SEG2[i*2],SEG2[i*2+1]) i>>=1 def getvalues(l,r): # 区間[l,r)に関するseg_functionを調べる L=l+seg_el R=r+seg_el ANS1=0 ANS2=0 while L>=1 R>>=1 L=l+seg_el R=r+seg_el ANS3=0 ANS4=0 while L>=1 R>>=1 return seg_function(ANS1, ANS2),seg_function(ANS3, ANS4) flag=0 for tests in range(Q): L=list(map(int,input().split())) if L[0]==1: x=L[1] A.append(x) update(len(A)-1,x,seg_el) elif L[0]==2: flag+=1 l,r=L[1],L[2] ANS=getvalues(l,r+1) print(*ANS) if flag==0: print("Not Found!")