use std::io::{read_to_string, stdin};

fn init_tree(tree: &mut Vec<i64>, arr: &Vec<i64>, i: usize, l: usize, r: usize) -> i64 {
    if l == r {
        tree[i] = arr[l];
        return arr[l];
    }
    let m = (l + r) / 2;
    tree[i] = init_tree(tree, arr, i * 2 + 1, l, m) + init_tree(tree, arr, 2 * i + 2, m + 1, r);
    return tree[i];
}

fn query(tree: &mut Vec<i64>, i: usize, l: usize, r: usize, ql: usize, qr: usize) -> i64 {
    if r < ql || l > qr {
        0
    } else if ql <= l && r <= qr {
        tree[i]
    } else {
        let m = (l + r) / 2;
        query(tree, 2 * i + 1, l, m, ql, qr) + query(tree, 2 * i + 2, m + 1, r, ql, qr)
    }
}

fn update(tree: &mut Vec<i64>, i: usize, l: usize, r: usize, ui: usize, uv: i64) {
    if l == r {
        tree[i] = uv;
        return;
    }
    let m: usize = (l + r) / 2;
    if ui <= m {
        update(tree, 2 * i + 1, l, m, ui, uv);
    } else {
        update(tree, 2 * i + 2, m + 1, r, ui, uv);
    }
    tree[i] = tree[2 * i + 1] + tree[2 * i + 2];
}

fn main() {
    let temp = read_to_string(stdin()).unwrap();
    let mut iter = temp
        .split_ascii_whitespace()
        .map(|x| x.parse::<i64>().unwrap());
    let (n, m, k) = (
        iter.next().unwrap() as usize,
        iter.next().unwrap() as usize,
        iter.next().unwrap() as usize,
    );
    let arr = (0..n).map(|_| iter.next().unwrap()).collect::<Vec<_>>();
    let mut tree = vec![0; 4 * n];

    init_tree(&mut tree, &arr, 0, 0, n - 1);

    for _ in 0..m + k {
        let inst = iter.next().unwrap();
        if inst == 1 {
            let i = iter.next().unwrap() as usize - 1;
            let c = iter.next().unwrap();
            update(&mut tree, 0, 0, n - 1, i, c);
        } else if inst == 2 {
            let (i, j) = (
                iter.next().unwrap() as usize - 1,
                iter.next().unwrap() as usize - 1,
            );
            println!("{}", query(&mut tree, 0, 0, n - 1, i, j));
        }
    }
}
