#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int bit[MAX_N+1],n,q;

//i???????????§??????????¨??????????(i???1????????????)
int sum(int i)
{
	int s = 0;
	while(i>0){
		s += bit[i];
		i -= i & -i;
	}
	return s;
}
//i???????????????x????????????(i???1????????????)
void add(int i,int x)
{
	while(i <= n){
		bit[i] += x;
		i += i & -i;
	}
}

int main()
{
	scanf("%d%d",&n,&q);
	rep(i,q){
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		if(x==0){
			add(y,z);
		}else{
			printf("%d\n",sum(z)-sum(y-1));
		}
	}
	return 0;
}