#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void getSum(int a[],int x,int y){
    int i;
    int sum=0;
    for(i=x;i<=y;i++){
        sum+=a[i];
    }
    printf("%d\n",sum);
}

int main(void){
    int i;
    
    int n;
    scanf("%d ",&n);
    
    int a[n];
    for(i=0;i<n;i++)a[i]=0;

    int q;
    scanf("%d\n",&q);
    
    int com,x,y;
    while(q--){
        scanf("%d %d %d\n",&com,&x,&y);
        switch(com){
            case 0:
                a[x-1]+=y;
                break;
            case 1:
                getSum(a,x-1,y-1);
                break;
        }
    }

    return 0;
}

