import heapq N,K,Q = map(int,input().split()) A = sorted(list(map(int,input().split()))) B = A[K-1:] C = sorted(A[:K],reverse=True) C = [-C[i] for i in range(K-1)] for _ in range(Q): qry = list(map(int,input().split())) if len(qry)==1: print(B[0]) else: if qry[0]==1: x = qry[1] if x>=-C[0]: heapq.heappush(B,x) else: x = -x y = -heapq.heappop(C) heapq.heappush(B,y) heapq.heappush(C,x) else: y = qry[1] x = heapq.heappop(B) heapq.heappush(B,x+y)