#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long ll;

int n, bit[262200] = {};

/*
void init(int n_) {
    n = 1;
    while (n < n_) n *= 2;
    for (int i = 0; i < 2 * n - 1; i++) dat[i] = pow(2, 31) - 1;
}*/

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

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


int main(void){
    int q;
    cin >> n >> q;
    
    //init(n);
    
    for (int i = 0; i < q; i++) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com) cout << sum(y) - sum(x - 1) << endl;
        else add(x, y);
    }
}

