#includecstdio
const int N=115;
int a,b,n,m,x,t[N];
void update(int poz,int st,int dr)
{
if(a=st && dr=b)
{
t[poz]+=x;
return;
}
int mid=(st+dr)1;
if(a=mid)
update(poz1,st,mid);
if(bmid)
update((poz1)+1,mid+1,dr);
t[poz]=t[poz1]+t[(poz1)+1];
}
int query(int poz,int st,int dr)
{
if(a=st && dr=b)
return t[poz];
int mid=(st+dr)1,s=0;
if(a=mid)
s+=query(poz1,st,mid);
if(bmid)
s+=query((poz1)+1,mid+1,dr);
return s;
}
int main()
{
freopen(datorii.in,r,stdin);
freopen(datorii.out,w,stdout);
int i,tip;
scanf(%d%d,&n,&m);
for(i=1;i=n;++i)
{
scanf(%d,&x);
a=b=i;
update(1,1,n);
}
while(m--)
{
scanf(%d,&tip);
if(tip)
{
scanf(%d%d,&a,&b);
printf(%dn,query(1,1,n));
}
else
{
scanf(%d%d,&i,&x);
x=-x;
a=b=i;
update(1,1,n);
}
}
return 0;
}