#include <stdio.h>

int a[100001];

void add(int b, int w, int n) {
	int i;
	for (i = b; i < n; i += b & (-b))
		a[i] += w;
}

int sum2(int b) {
	int i, ans = 0;
	for (i = b; i > 0; i -= b & (-b))
		ans += a[i];
	return ans;
}

int sum(int b, int c) {
	return (sum2(c) - sum2(b - 1));
}

void init(int a[], int n) {
	int i;
	for (i = 0; i < n; i++)
		a[i] = 0;
}

int main(void) {
	int n, q, com, x, y;

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

	while (q--) {
		scanf("%d %d %d", &com, &x, &y);
		if (com == 0)
			add(x, y, n);
		else
			printf("%d\n", sum(x, y));
	}

	return 0;
}