#include <stdio.h>

#define MAX 100001

int A[MAX];
int B[MAX];

int main(void) {
	int i, j, n, q, m;
	int com, x, y;
	int *p;
	int *b;

	scanf("%d %d\n", &n, &q);
	for(i=0;i<=n;i++) {
		A[i] = 0;
		B[i] = 0;
	}
	
	for(i=0;i<q;i++) {
		scanf("%d %d %d\n", &com, &x, &y);
		if(com == 0) {
			A[x] += y;
			for(j=x,b=&B[j];j<=n;j++,b++) *b += y;
		} else {
			printf("%d\n", B[y]-B[x-1]);
		}
	}
	
	return 0;
}