#include<cstdio>
#include<iostream>
using namespace std;
int a[100005],b[100005];
int lowbit(int x)
{
    return x&(-x);
}
int n;
void add(int x,int y)
{
    for(int i=x;i<=n;i+=lowbit(i))
    {
        b[i]+=y;
    }
}
int sum(int x)
{
    int ans=0;
    for(int i=x;i;i-=lowbit(i))
    {
        ans+=b[i];
    }
    return ans;
}
int main()
{
    freopen("shulieb.in","r",stdin);
    freopen("shulieb.out","w",stdout); 
    int m;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        //add(i,a[i]);
    }
    scanf("%d",&m);
    int x,y,k;
    for(int i=1;i<=m;i++)
    {
        char s[10];
        scanf("%s",s);
        if(s[0]=='A')
        {
            scanf("%d%d%d",&x,&y,&k);
            add(x,k);
            add(y+1,-k);
        }
        else
        if(s[0]=='Q')
        {
            scanf("%d",&x);
            printf("%d\n",sum(x)+a[x]);
        }
    }
    return 0;
}