cnt = 1
while n = gets.to_i
  break if n == 0
  xs = []
  ys = []
  ps = []
  n.times do
    x, y, r = gets.split.map(&:to_f)
    ps << [x, y, r]
    xs << x - r << x + r
    ys << y - r << y + r
  end
  xs.sort!.uniq!; ys.sort!.uniq!
  p = ys.size.times.map{ [0] * xs.size }
  ps.each do |x, y, r|
    (xs.index(x - r)...xs.index(x + r)).each do |i|
      (ys.index(y - r)...ys.index(y + r)).each do |j|
        p[j][i] += 1
      end
    end
  end
  ret = 0
  xs.each_cons(2).with_index do |(x0, x1), i|
    ys.each_cons(2).with_index do |(y0, y1), j|
      ret += (x1 - x0) * (y1 - y0) if p[j][i] > 0
    end
  end
  puts "#{cnt} #{ret}"
  cnt += 1
end