#include <bits/stdc++.h>
#define int long long
#define N 500010
using namespace std;
struct node{
int l,r,sum,lazy;
}tree[4*N];
int arr[N+1];
void pushdown(int u){
if(tree[u].lazy!=0){
tree[2*u].sum += (tree[2*u].r - tree[2*u].l + 1) * tree[u].lazy;
tree[2*u + 1].sum += (tree[2*u + 1].r - tree[2*u + 1].l + 1) * tree[u].lazy;
tree[2*u].lazy += tree[u].lazy;
tree[2*u + 1].lazy += tree[u].lazy;
tree[u].lazy = 0;
}
}
void build(int l,int r,int u){//建立线段树
tree[u].l=l,tree[u].r=r;
if(l==r){
tree[u].sum=arr[l];
return ;
}
int mid=(l+r)/2;
build(l,mid,2*u);
build(mid+1,r,2*u+1);
tree[u].sum=tree[2*u].sum+tree[2*u+1].sum;
}
int search(int l,int r,int u){//查询区间和
if(tree[u].l>r||tree[u].r<l) return 0;
if(tree[u].l>=l&&tree[u].r<=r) return tree[u].sum;
pushdown(u);
int mid=(tree[u].l+tree[u].r)/2;
int sum=0;
if(l<=mid) sum+=search(l,r,2*u);
if(r>mid) sum+=search(l,r,2*u+1);
return sum;
}
void update(int pos,int val,int l,int r,int u){//单点修改
if(l==r){
arr[pos]=val;
tree[u].sum=val;
return ;
}
int mid=(l+r)/2;
if(pos<=mid) update(pos,val,l,mid,2*u);
if(pos>mid) update(pos,val,mid+1,r,2*u+1);
tree[u].sum=tree[2*u].sum+tree[2*u+1].sum;
}
void update1(int val,int l,int r,int u){
if(tree[u].l>r||tree[u].r<l) return ;
if(tree[u].l>=l&&tree[u].r<=r){
tree[u].sum += (tree[u].r-tree[u].l+1)*val;
tree[u].lazy += val;
return ;
}
pushdown(u);
int mid=(tree[u].l+tree[u].r)/2;
if(l<=mid) update1(val,l,r,2*u);
if(r>mid) update1(val,l,r,2*u+1);
tree[u].sum=tree[2*u].sum+tree[2*u+1].sum;
}
signed main(){
int n,m;
scanf("%lld%lld",&n,&m);
for(int i=1;i<=n;i++){
scanf("%lld",&arr[i]);
}
build(1,n,1);
for(int i=1;i<=m;i++){
char tot;
cin >> tot;
if(tot=='C'){
int a,b,k;
scanf("%lld%lld%lld",&a,&b,&k);
update1(k,a,b,1);
}
else{
int a;
scanf("%lld",&a);
int res=search(a,a,1);
printf("%lld\n",res);
}
}
return 0;
}
//Planet_Earth