#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define lowbit(x) x&(-x)
int n, w, x, y;
char t;
int c[100005];
void add(LL x, LL v){
for(LL i = x; i <= n; i+=lowbit(i))
c[i] += v;
}
LL ask(LL x){
LL sum = 0;
for(LL i = x; i >= 1; i-=lowbit(i)){
sum += c[i];
}
return sum;
}
int main(){
scanf("%d%d",&n,&w);
while(w--){
cin >> t >> x >> y;
if(t == 'x'){
add(x,y);
}
else if(t == 'y'){
printf("%lld\n", ask(y)-ask(x-1));
}
}
return 0;
}