#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

class BIT
{
private:
	std::vector<LL>dat;

public:
	void init(LL size)
	{
		dat.resize(size + 1, 0);
	}

	void update(LL k, LL x)
	{
		if (k >= dat.size()) return;
		dat[k] += x;
		update(k + (k & -k), x);
	}

	LL sum(LL k)
	{
		if (!k) return 0;
		return dat[k] + sum(k - (k & -k));
	}
};

int main()
{
	LL n, q;
	in >> n >> q;

	BIT tree;
	tree.init(n + 1);
	rep(loop, q)
	{
		LL com, x, y;
		in >> com >> x >> y;
		if (com == 0) tree.update(x, y);
		else out << tree.sum(y) - tree.sum(x - 1) << std::endl;
	}
}

