def add(a, b, k, l, r, node)
  return 0 if r <= a || b <= l
  return node[k] if a <= l && r <= b
  m = (l+r)/2
  vl = add(a, b, 2*k+1, l, m, node)
  vr = add(a, b, 2*k+2, m, r, node)
  return vl + vr
end

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

m = 1
while m < n
  m *= 2
end
node = Array.new(2*m-1){0}

q.times{
  com, x, y = gets.split.map(&:to_i)
  x -= 1
  case com
  when 0
    k = x + m - 1
    node[k] += y
    while k > 0
      k = (k-1)/2
      node[k] += y
    end
  when 1
    puts add(x, y, 0, 0, m, node)
  end
}