#include <stdio.h>

int n, q, a[100005],com,x,y;

void add(int x, int y) {
    a[x]+=y;
    return;
}

void getsum(int x, int y) {
    int count=0;
    for (int j = x; j <= y; j++)
    {
        count+=a[j];
    }
    printf("%d\n",count);
    return;
}


int main () {
    scanf("%d%d",&n,&q);
    for (int i = 1; i <= q; i++)
    {
        scanf("%d%d%d",&com,&x,&y);
        (com==0)?add(x,y):getsum(x,y);
        
    }
    

}
