#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;

struct bar{
	double x1, x2, y;
	bool f;
	
	bar(double x1, double x2, double y, bool f)
		: x1(x1), x2(x2), y(y), f(f) {}
	
	bool operator<(const bar &b) const{
		return y < b.y;
	}
};

int main(){
	int n;
	double x, y, r;
	for(int number = 1; scanf("%d", &n), n != 0; ++number){
		vector<bar> bars;
		vector<double> xs;
		bars.reserve(2 * n);
		xs.reserve(2 * n);

		for(int i = 0; i < n; ++i){
			scanf("%lf%lf%lf", &x, &y, &r);
			double x1 = x - r;
			double x2 = x + r;
			
			xs.push_back(x1);
			xs.push_back(x2);
			bars.push_back( bar(x1, x2, y - r, true) );
			bars.push_back( bar(x1, x2, y + r, false) );
		}
		
		sort(xs.begin(), xs.end());
		xs.erase( unique(xs.begin(), xs.end()), xs.end() );
		sort(bars.begin(), bars.end());

		double ans = 0.0;
		for(int i = 1; i < xs.size(); ++i){
			int cnt = 0;
			double prev = 0.0;
			double len = 0.0;

			for(int j = 0; j < bars.size(); ++j){
				if( bars[j].x1 < xs[i] && bars[j].x2 >= xs[i] ){
					if( bars[j].f ){
						if( ++cnt == 1 ){
							prev = bars[j].y;
						}
					}
					else{
						if( --cnt == 0 ){
							len += bars[j].y - prev;
						}
					}
				}
			}
			
			ans += (xs[i] - xs[i-1]) * len;
		}
		
		printf("%d %.2f\n", number, ans);
	}

}