#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
long BIT[100010] = { 0 };
int n;
void update(int pos, int x);
long long sum(int k);//sum from 1 to k
inline int lowbit(int x) { return x&(-x); }
int main()
{
freopen("shulie.in", "r", stdin);
freopen("shulie.out", "w", stdout);
ios::sync_with_stdio(0);
cin >> n;
int num;
for (int i = 1; i <= n; ++i)
{
cin >> num;
update(i, num);
}
int m;
cin >> m;
string str;
int k, d, s, t;
for (int i = 1; i <= m; ++i)
{
cin >> str;
if (str == "ADD")
{
cin >> k >> d;
update(k, d);
}
else if (str == "SUM")
{
cin >> s >> t;
cout << sum(t)-sum(s-1) << endl;
}
}
return 0;
}
void update(int pos, int x)
{
while (pos <= n)
{
BIT[pos] += x;
pos += lowbit(pos);
}
}
long long sum(int k)
{
if (k == 0)
{
return 0;
}
long long res = 0;
while (k > 0)
{
res += BIT[k];
k -= lowbit(k);
}
return res;
}