n, q = gets.split.map(&:to_i)

node = Array.new(n){0}

q.times{
  com, x, y = gets.split.map(&:to_i)
  x -= 1
  case com
  when 0
    node[x] += y
  when 1
    y -= 1
    p node[x..y].inject(:+)
  end
}