#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#pragma GCC optimize(2)
#endif
#define INF 0x3f3f3f3f
#define N 500005
#define ll long long
#define ull unsigned long long
#define il inline
#define rg register
using namespace std;
ull n, m;
ull tr[N];
ull lowbit(ull x)
{
return x & -x;
}
void add(ull x, ull c)
{
for (int i = x; i <= n; i += lowbit(i))
tr[i] += c;
}
ull sum(ull x)
{
ull res = 0;
for (int i = x; i; i -= lowbit(i))
res += tr[i];
return res;
}
int main()
{
cin >> n >> m;
for (int i = 1; i <= m; i++)
{
char c;
int x, y;
cin >> c >> x >> y;
if (c == 'x')
add(x, y);
if (c == 'y')
cout << sum(y) - sum(x - 1) << endl;
}
system("pause");
return 0;
}