#include <stdio.h>
#define MAX_N 100000

int sum(int *array, int begin, int end) {
	int i, s = 0;

	for (i = begin; i < end; i++) {
		s += array[i];
	}
	return s;
}

int main(void) {
	int n, q, com, x, y, bx, by, s;
	int a[MAX_N] = {0}, b[MAX_N] = {0};

	scanf("%d %d", &n, &q);

	while (q--) {
		scanf("%d %d %d", &com, &x, &y);

		x--;
		if (com) {
			bx = x - x % 100 + 100;
			by = y - y % 100;
			if (bx < by) {
				s = sum(a, x, bx) + sum(b, bx/100, by/100) + sum(a, by, y);
			} else {
				s = sum(a, x, y);
			}
			printf("%d\n", s);
		} else {
			a[x] += y;
			bx = x - x % 100;
			b[x/100] = sum(a, bx, bx+100);
		}
	}
	return 0;
}