#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn = 100010;
int gi() {
char ch=getchar(); int x=0;
while(ch<'0' || ch>'9') ch=getchar();
while(ch>='0' && ch<='9') {x=10*x+ch-'0';ch=getchar();}
return x;
}
int n,q;
int a[maxn],c[maxn];
int lowbit(int x) {return x&(-x);}
void add(int x, int de) {
while(x<=n) {c[x]+=de,x+=lowbit(x);}
}
int sum(int x) {
int res=0;
while(x|0) {res+=c[x],x-=lowbit(x);}
return res;
}
int main() {
n=gi();
for(int i=1; i<=n; i++) {a[i]=gi();add(i,a[i]);}
q=gi();
for(int i=1; i<=q; i++) {
char s[5]; int x,y;
scanf("%s%d%d", s,&x,&y);
if(s[0]=='A') add(x,y);
if(s[0]=='S') printf("%d\n", sum(y)-sum(x-1));
}
return 0;
}