#include <stdio.h>          // printf(), scanf()
#define MAX_N 100000

int bit[MAX_N + 1];
int n;

void
bit_init()
{
	int i;

	for (i = 0; i <= n; ++i)
		bit[i] = 0;
}

void
bit_add(int i, int v)
{
	while (i <= n)
	{
		bit[i] += v;
		i += i & -i;
	}
}

int
bit_sum(int i)
{
	int sum = 0;
	while (i > 0)
	{
		sum += bit[i];
		i -= i & -i;
	}

	return sum;
}

int
main(int argc, char** argv)
{
	int q;
	int c, x, y;

	scanf("%d %d", &n, &q);
	bit_init();
	while (q--)
	{
		scanf("%d %d %d", &c, &x, &y);
		if (c == 0)
			bit_add(x, y);
		else
			printf("%d\n", bit_sum(y) - bit_sum(x - 1));
	}

	return 0;
}