#include <stdio.h>

#define MAX 100001

int A[MAX];

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

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