
Y, X1, X2, Flag = (0...4).to_a
Top, Bottom = 0, 1

data = 0
while (n = gets.to_i) != 0 do
  edge = Array.new
  n.times do
    x, y, r = gets.split.map(&:to_f)
    edge.push([y-r, x-r, x+r, Top], [y+r, x-r, x+r, Bottom])
  end
  edge.sort!{|a, b| a[Y] <=> b[Y]}

  answer = 0.0
  point = Array.new.push(edge.first[X1], edge.first[X2])
  for i in 1...edge.size do
    answer += (point.max - point.min) * (edge[i][Y] - edge[i-1][Y])
    x1, x2 = edge[i][X1], edge[i][X2]
    case edge[i][Flag]
      when Top
        point.push(x1, x2)
      when Bottom
        point.delete_at(point.index(x1))
        point.delete_at(point.index(x2))
    end
  end
  data += 1
  printf "%d %.2f\n", data, answer
end