import typing class FenwickTree: '''Reference: https://en.wikipedia.org/wiki/Fenwick_tree''' def __init__(self, n: int = 0) -> None: self._n = n self.data = [0] * n def add(self, p: int, x: typing.Any) -> None: assert 0 <= p < self._n p += 1 while p <= self._n: self.data[p - 1] += x p += p & -p def sum(self, left: int, right: int) -> typing.Any: assert 0 <= left <= right <= self._n return self._sum(right) - self._sum(left) def _sum(self, r: int) -> typing.Any: s = 0 while r > 0: s += self.data[r - 1] r -= r & -r return s N, Q, L0 = map(int, input().split()) A = list(map(int, input().split())) f = FenwickTree(200001) fi = FenwickTree(200001) for i in A: f.add(i, 1) fi.add(i, i) c = 0 for _ in range(Q): t, *q = map(int, input().split()) if t == 1: l = q[0] f.add(l, 1) fi.add(l, l) if t == 2: c += 1 l, r = q print(f.sum(l, r + 1), fi.sum(l, r + 1)) if t == 3: m = q[0] if c == 0: print("Not Found!")