士兵杀敌(二)
try:
while True:
N, M = map(int, input().split())
value = list(map(int, input().split()))
for i in range(M):
a,b,c=input().split()
if a=='QUERY':
print(sum(value[int(b)-1:int(c)]))
else:
value[int(b)-1]+=int(c)
except EOFError:
pass