import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int q = sc.nextInt(); sc.nextInt(); SegmentTree st = new SegmentTree(20001); StringBuilder sb = new StringBuilder(); while (n-- > 0) { st.add(sc.nextInt()); } while (q-- > 0) { int type = sc.nextInt(); if (type == 1) { st.add(sc.nextInt()); } else if (type == 2) { int left = sc.nextInt(); int right = sc.nextInt(); sb.append(st.getCount(left, right + 1)).append(" ").append(st.getSum(left, right + 1)).append("\n"); } else { sc.nextInt(); } } System.out.print(sb.length() == 0 ? "Not Found!\n" : sb); } static class SegmentTree { int size; int[] counts; long[] sums; public SegmentTree(int x) { size = 2; while (size < x) { size <<= 1; } counts = new int[size * 2 - 1]; sums = new long[size * 2 - 1]; } public void add(int x) { int current = x + size - 1; counts[current]++; sums[current] += x; calc((current - 1) / 2); } private void calc(int idx) { counts[idx] = counts[idx * 2 + 1] + counts[idx * 2 + 2]; sums[idx] = sums[idx * 2 + 1] + sums[idx * 2 + 2]; if (idx > 0) { calc((idx - 1) / 2); } } public int getCount(int left, int right) { return getCount(0, 0, size, left, right); } private int getCount(int idx, int min, int max, int left, int right) { if (max <= left || right <= min) { return 0; } else if (left <= min && max <= right) { return counts[idx]; } else { return getCount(idx * 2 + 1, min, (min + max) / 2, left, right) + getCount(idx * 2 + 2, (min + max) / 2, max, left, right); } } public long getSum(int left, int right) { return getSum(0, 0, size, left, right); } private long getSum(int idx, int min, int max, int left, int right) { if (max <= left || right <= min) { return 0; } else if (left <= min && max <= right) { return sums[idx]; } else { return getSum(idx * 2 + 1, min, (min + max) / 2, left, right) + getSum(idx * 2 + 2, (min + max) / 2, max, left, right); } } } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }