#include<bits/stdc++.h>
using namespace std;
int m,n,p;
int a[100001],tree[1000001];
int lowbit(int k)
{ return k&-k;
}
int sum(int x)
{ int ans=0;
while (x>0)
{ ans+=tree[x];
x-=lowbit(x);
}
return ans;
}
void add(int x,int k)
{ while (x<=n)
{ tree[x]+=k;
x+=lowbit(x);
}}
int main()
{ freopen("shulie.in","r",stdin);
freopen("shulie.out","w",stdout);
scanf("%d",&n);
for (register int i=1;i<=n;i++)
{scanf("%d",&a[i]);
add(i,a[i]);}
scanf("%d",&p);
string s;
for (int i=1;i<=p;i++)
{ cin>>s;
int x,y;
scanf("%d%d",&x,&y);
if (s=="SUM") printf("%d\n",sum(y)-sum(x-1));
if (s=="ADD") add(x,y);
}
return 0;
}