You are given a sequence of n integers a1,a2,…,an, where every element lies in the range [0,k−1]. Perform m operations of the following two kinds on this sequence.
The first line contains three integers n, k, and m (1≤n≤100000, 1≤k≤10, 1≤m≤100000). The second line contains n integers a1,a2,…,an describing the sequence (0≤ai≤k−1).
Each of the next m lines describes one operation. Each line begins with an integer z giving the operation type. If z=1, it is a range-sum query and is followed by two integers c and d. If z=2, it is a range-update operation and is followed by three integers c, d, and l (1≤c≤d≤n, 0≤l≤k−1).
For each range-sum operation, print the computed result on its own line.