#include<cstdio>
#include<iostream>
using namespace std;
#define N 100005
#define lowbit(x) x & (-x)
int c[N];
int n;
inline int getint(){
int x = 0; char ch;
while (!isdigit(ch = getchar()));
x = ch - 48;
while (isdigit(ch = getchar())) x = x * 10 + ch - 48;
return x;
}
void insert(int x, int z){
for (int i = x; i <= n; i += lowbit(i))
c[i] += z;
}
int ask(int x){
int ans = 0;
for (int i = x; i > 0; i -= lowbit(i))
ans += c[i];
return ans;
}
int main(){
freopen("shulie.in", "r", stdin);
freopen("shulie.out", "w", stdout);
//scanf("%d",&n);
n = getint();
int x, y;
for (int i = 1; i <= n; i++)
x = getint(),insert(i,x);
int Q;
Q = getint();
char ch;
for (;Q--;){
while (1){
ch = getchar();
if (ch == 'A' || ch == 'S') break;
}
switch(ch){
case 'A':{
x = getint(); y = getint();
insert(x, y);
break;
}
case 'S':{
x = getint(); y = getint();
printf("%d\n",ask(y) - ask(x - 1));
break;
}
}
}
return 0;
}