#include <stdio.h>

int main() {
  int n, q, i, command, x, y, sum;

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

  int nums[n];
  memset(nums, 0, sizeof(nums));

  for (i = 0; i < q; i++) {
    scanf("%d %d %d", &command, &x, &y);
    if (command) {
      sum = 0;
      for (i = x; i < y; i++)
	sum += nums[i];
      printf("%d\n", sum);
    } else {
      nums[x] += y;
    }
  }
}

