#include<iostream>
#include<stdio.h>
#include<vector>

using namespace std;
int main() {
	int n, q;
	scanf("%d %d", &n, &q);
	
	vector <int> a;
	//初期値の設定
	for (int i = 0; i < n+1; i++) {
		a.push_back(0);
	}

	int com, x, y;
	for (int i = 0; i < q; i++) {
		scanf("%d %d %d",&com, &x, &y);

		if (com == 0) {
			a[x] += y;
		}
		else {

			int sum = 0;
			int j = x;
			while (1) {
				sum += a[j];				
				
				if (j == y)break;
				j++;
			}
			printf("%d\n", sum);
		}
	}return 0;
}
