#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int n, q;
cin >> n >> q;
vector<int> v(n+1, 0);
vector<int> a(n+1, 0);
for(int i = 1; i <= n; i++){
cin >> a[i];
int k = i;
while(k <= n){
v[k] += a[i];
k += k & -k;
}
}
while(q--){
int type;
cin >> type;
cout << 10 - q << ":";
if(type == 1){
int k, u;
cin >> k >> u;
u -= a[k];
while(k <= n){
v[k] += u;
k += k & -k;
}
cout<<endl;
}
else if(type == 2){
int a, b;
cin >> a >> b;
a--;
for(int i = 1; i <= n; i++){
cout << v[i] << " ";
}
int sa = 0, sb = 0;
while (a > 0){
sa += v[a];
a -= a & -a;
}
while (b > 0){
sb += v[b];
b -= b & -b;
}
cout<< sb << sa << endl;
}
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHZlY3Rvcj4KI2luY2x1ZGU8YWxnb3JpdGhtPgojaW5jbHVkZTxjbWF0aD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpewogICAgaW50IG4sIHE7CiAgICBjaW4gPj4gbiA+PiBxOwogICAgdmVjdG9yPGludD4gdihuKzEsIDApOwogICAgdmVjdG9yPGludD4gYShuKzEsIDApOwogICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspewogICAgICAgIGNpbiA+PiBhW2ldOwogICAgICAgIGludCBrID0gaTsKICAgICAgICB3aGlsZShrIDw9IG4pewogICAgICAgICAgICB2W2tdICs9IGFbaV07CiAgICAgICAgICAgIGsgKz0gayAmIC1rOwogICAgICAgIH0KICAgIH0KCiAgICB3aGlsZShxLS0pewogICAgICAgIGludCB0eXBlOwogICAgICAgIGNpbiA+PiB0eXBlOwogICAgICAgIGNvdXQgPDwgMTAgLSBxIDw8ICI6IjsKICAgICAgICBpZih0eXBlID09IDEpewogICAgICAgICAgICBpbnQgaywgdTsKICAgICAgICAgICAgY2luID4+IGsgPj4gdTsKICAgICAgICAgICAgdSAtPSBhW2tdOwogICAgICAgICAgICB3aGlsZShrIDw9IG4pewogICAgICAgICAgICAgICAgdltrXSArPSB1OwogICAgICAgICAgICAgICAgayArPSBrICYgLWs7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgY291dDw8ZW5kbDsKICAgICAgICB9CgogICAgICAgIGVsc2UgaWYodHlwZSA9PSAyKXsKICAgICAgICAgICAgaW50IGEsIGI7CiAgICAgICAgICAgIGNpbiA+PiBhID4+IGI7CiAgICAgICAgICAgIGEtLTsKICAgICAgICAgICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspewogICAgICAgICAgICAJY291dCA8PCB2W2ldIDw8ICIgIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBpbnQgc2EgPSAwLCBzYiA9IDA7CiAgICAgICAgICAgIHdoaWxlIChhID4gMCl7CiAgICAgICAgICAgICAgICBzYSArPSB2W2FdOwogICAgICAgICAgICAgICAgYSAtPSBhICYgLWE7CiAgICAgICAgICAgIH0gCiAgICAgICAgICAgIHdoaWxlIChiID4gMCl7CiAgICAgICAgICAgICAgICBzYiArPSB2W2JdOwogICAgICAgICAgICAgICAgYiAtPSBiICYgLWI7CiAgICAgICAgICAgIH0gCiAgICAgICAgICAgIGNvdXQ8PCBzYiA8PCBzYSA8PCBlbmRsOwogICAgICAgIH0KICAgIH0KfQo=