// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<b;i++)

#define rrep(i,a,b) for(int i=a;i>=b;i--)

#define fore(i,a) for(auto &i:a)

#pragma GCC optimize ("-O3")

using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }

//---------------------------------------------------------------------------------------------------

#define def 0

template<class V, int NV> struct SegTree { //[l,r)

    V comp(V& l, V& r) { return l + r; };

    vector<V> val; SegTree() { val = vector<V>(NV * 2, def); }

    V get(int x,int y,int l=0,int r=NV,int k=1){if(r<=x||y<=l)return def;if(x<=l&&r<=y)return val[k];

    auto a=get(x,y,l,(l+r)/2,k*2);auto b=get(x,y,(l+r)/2,r,k*2+1);return comp(a,b);}

    void update(int i, V v) { i+=NV;val[i]=v;while(i>1)i>>=1,val[i]=comp(val[i*2],val[i*2+1]); }

    void add(int i, V v) { update(i, val[i + NV] + v); }};

/*---------------------------------------------------------------------------------------------------

????????????????????????????????? ??§?????§  

??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!

???????????? ??? ?´_???`??????/??? ???i     

?????????????????????????????? ???  |???|     

????????? /?????? /??£??£??£??£/??????|  

??? ???_(__??????/???    ???/ .| .|????????????  

??? ????????????/????????????/??????u??????  

---------------------------------------------------------------------------------------------------*/







int N, Q;

SegTree<int, 1 << 17> st;

//---------------------------------------------------------------------------------------------------

void _main() {

    cin >> N >> Q;

    rep(i, 0, Q) {

        int c, x, y; cin >> c >> x >> y;

        if (c == 0) st.add(x - 1, y);

        else printf("%d\n", st.get(x - 1, y));

    }

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=a;i<b;i++)

#define rrep(i,a,b) for(int i=a;i>=b;i--)

#define fore(i,a) for(auto &i:a)

#pragma GCC optimize ("-O3")

using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }

//---------------------------------------------------------------------------------------------------

template<class V> struct BIT {  // [L, R)

    int NV; vector<V> bit; void init(int n) { NV = 1; while (NV < n) NV *= 2; bit.resize(NV); }

    V operator[](int e) { V s = 0; e++; while (e) s += bit[e - 1], e -= e&-e; return s; }

    void add(int e, V v) { e++; while (e <= NV) bit[e - 1] += v, e += e&-e; }

    int lower_bound(V val) { V tv = 0; int i, ent = 0; for (i = NV - 1; i >= 0; i--)

        if(tv+bit[ent+(1<<i)-1]<=val)tv+=bit[ent+(1<<i)-1],ent += (1 << i);return ent;}

    V get(int L, int R) {assert(0 <= L); assert(R <= NV); assert(L <= R);

        V res = 0; if(R) res += operator[](R - 1); if (L) res -= operator[](L - 1);return res;}

    void clear() { bit.clear(); }};

/*---------------------------------------------------------------------------------------------------

????????????????????????????????? ??§?????§  

??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!

???????????? ??? ?´_???`??????/??? ???i     

?????????????????????????????? ???  |???|     

????????? /?????? /??£??£??£??£/??????|  

??? ???_(__??????/???    ???/ .| .|????????????  

??? ????????????/????????????/??????u??????  

---------------------------------------------------------------------------------------------------*/











int N, Q;

//---------------------------------------------------------------------------------------------------

void _main() {

    cin >> N >> Q;



    BIT<int> bit;

    bit.init(N);



    rep(q, 0, Q) {

        int a, b, c; cin >> a >> b >> c;

        if (a == 0) bit.add(b - 1, c);

        else {

            int ans = bit.get(b - 1, c);

            printf("%d\n", ans);

        }

    }

}

// Fastest known solution for this problem: