#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 105;

vector<double> X,Y,X1,Y1,X2,Y2;
bool flag[MAX_N*2][MAX_N*2];
int n;

int main()
{
	double p,q,r;
	int id=1;
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		X.clear(),Y.clear(),X1.clear(),Y1.clear(),X2.clear(),Y2.clear();
		rep(i,n*2){
			rep(j,n*2){
				flag[i][j] = false;
			}
		}
		rep(i,n){
			scanf("%lf%lf%lf",&p,&q,&r);
			X.push_back(p+r),X.push_back(p-r);
			Y.push_back(q+r),Y.push_back(q-r);
			X1.push_back(p-r),X2.push_back(p+r);
			Y1.push_back(q-r),Y2.push_back(q+r);
		}
		sort(X.begin(),X.end());
		sort(Y.begin(),Y.end());
		X.erase(unique(X.begin(),X.end()),X.end());
		Y.erase(unique(Y.begin(),Y.end()),Y.end());
		rep(i,n){
			X1[i] = lower_bound(X.begin(),X.end(),X1[i]) - X.begin();
			Y1[i] = lower_bound(Y.begin(),Y.end(),Y1[i]) - Y.begin();
			X2[i] = lower_bound(X.begin(),X.end(),X2[i]) - X.begin();
			Y2[i] = lower_bound(Y.begin(),Y.end(),Y2[i]) - Y.begin();
		}
		rep(i,n){
			for(int j=Y1[i];j<Y2[i];j++){
				for(int k=X1[i];k<X2[i];k++){
					flag[j][k] = true;
				}
			}
		}
		double ans = 0;
		rep(i,Y.size()-1){
			rep(j,X.size()-1){
				if(flag[i][j]){
					ans += (X[j+1]-X[j])*(Y[i+1]-Y[i]);
				}
			}
		}
		printf("%d %.2f\n",id,ans);
		id++;
	}
	return 0;
}