#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int n, c; double x, y, r;
int main() {
	while (cin >> n, n) {
		vector<double> xa(n), ya(n), xb(n), yb(n);
		for (int i = 0; i < n; i++) {
			cin >> x >> y >> r;
			xa[i] = x - r; ya[i] = y - r;
			xb[i] = x + r; yb[i] = y + r;
		}
		vector<double> xc, yc;
		for (int i = 0; i < n; i++) {
			xc.push_back(xa[i]);
			yc.push_back(ya[i]);
			xc.push_back(xb[i]);
			yc.push_back(yb[i]);
		}
		sort(xc.begin(), xc.end());
		xc.resize(unique(xc.begin(), xc.end()) - xc.begin());
		sort(yc.begin(), yc.end());
		yc.resize(unique(yc.begin(), yc.end()) - yc.begin());
		for (int i = 0; i < n; i++) {
			xa[i] = lower_bound(xc.begin(), xc.end(), xa[i]) - xc.begin();
			ya[i] = lower_bound(yc.begin(), yc.end(), ya[i]) - yc.begin();
			xb[i] = lower_bound(xc.begin(), xc.end(), xb[i]) - xc.begin();
			yb[i] = lower_bound(yc.begin(), yc.end(), yb[i]) - yc.begin();
		}
		vector<vector<int> > imos(yc.size(), vector<int>(xc.size()));
		vector<vector<int> > sum(yc.size() + 1, vector<int>(xc.size() + 1));
		for (int i = 0; i < n; i++) {
			imos[ya[i]][xa[i]]++;
			imos[ya[i]][xb[i]]--;
			imos[yb[i]][xa[i]]--;
			imos[yb[i]][xb[i]]++;
		}
		double ret = 0;
		for (int i = 0; i < yc.size(); i++) {
			for (int j = 0; j < xc.size(); j++) {
				sum[i + 1][j + 1] = sum[i + 1][j] + sum[i][j + 1] - sum[i][j] + imos[i][j];
				if (sum[i + 1][j + 1] > 0) ret += (xc[j + 1] - xc[j]) * (yc[i + 1] - yc[i]);
			}
		}
		printf("%d %.2lf\n", ++c, ret);
	}
	return 0;
}