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

using namespace std;

int main() {
	int n, q, x, y, com, tmp;
	cin >> n >> q;
	vector<int> a(n+1, 0);
	for (int i = 0; i < q; ++i) {
		cin >> com >> x >> y;
		if (com == 0) {
			a[x] += y;
		}
		else {
			int ans=0;
			for (int j = x; j <= y; ++j) {
				ans += a[j];
			}
			cout << ans << endl;
		}
	}
	return 0;
}
