#include<stdio.h>

int main(void){

  int a[10000]={};
  int getSum[10000]={};
  int i=0;  
  int time=0;
  int b,x,s,t,n,q,d;

  scanf("%d %d",&n,&q);

 

  while(i<=q){
    i++;
       scanf("%d",&b);
   if(b==0){
   scanf("%d",&d);
   scanf("%d",&x);
   a[d] += x;
   }
 
   else if(b==1){
     time++;
   scanf("%d",&s);
   scanf("%d",&t);
   
   for(s;s<=t;s++){
     getSum[time] += a[s];
   }

   }


  }

  i=0;

  while(i<time){
    ++i;
    printf("%d\n",getSum[i]);

  }
  


}