def add(x,y): return x + y class segtree(): def __init__(self,n,op,e): self.n = n self.size = 1 << ((n - 1).bit_length()) self.e = e self.seg = [e for i in range(self.size << 1)] self.op = op def set(self,i,x): j = i + self.size self.seg[j] = x j >>= 1 while j: self.seg[j] = self.op(self.seg[j << 1],self.seg[(j << 1) ^ 1]) j >>= 1 return 0 def add(self,i,x): self.set(i,self.get(i) + x) return def set_array(self,A): for i in range(self.n): self.set(i,A[i]) return def get(self,i): return self.seg[i + self.size] def prod(self,l,r): sml = self.e smr = self.e ll = l + self.size rr = r + self.size while ll < rr: if ll & 1: sml = self.op(sml,self.seg[ll]) ll += 1 if rr & 1: smr = self.op(smr,self.seg[rr-1]) rr -= 1 ll >>= 1 rr >>= 1 return self.op(sml,smr) def max_right(self,l,f): if l == self.n: return self.n ll = l + self.size sm = self.e while True: while ll % 2 == 0: ll >>= 1 if not(f(self.op(sm,self.seg[ll]))): while ll < self.size: ll <<= 1 if f(self.op(sm,self.seg[ll])): sm = self.op(sm,self.seg[ll]) ll += 1 return ll - self.size sm = self.op(sm,self.seg[ll]) ll += 1 if (ll & -ll) == ll: break return self.n def min_left(self,r,f): if r == 0: return 0 rr = r + self.size sm = self.e while True: rr -= 1 while (rr > 1 and (rr % 2)): rr >>= 1 if not(f(self.op(self.seg[rr],sm))): while (rr < self.size): rr = (rr << 1) + 1 if self.op(sm,self.seg[rr]): sm = self.op(sm,self.seg[rr]) rr -= 1 return rr + 1 - self.size sm = self.op(sm,self.seg[rr]) if (rr & -rr) == rr: break return 0 N,Q,L = map(int,input().split()) A = list(map(int,input().split())) M = 200001 seg = segtree(M,add,0) segg = segtree(M,add,0) for a in A: seg.set(a,seg.get(a) + 1) segg.set(a,segg.get(a) + a) f = 1 for _ in range(Q): q = list(map(int,input().split())) if q[0] == 1: l = q[1] seg.set(l,seg.get(l) + 1) segg.set(l,segg.get(l) + l) elif q[0] == 2: f = 0 l,r = q[1],q[2] print(seg.prod(l,r + 1),segg.prod(l,r + 1)) else: m = q[1] if f: print('Not Found!')