#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>

using namespace std;

const double EPS=(1e-10);
typedef long long ll;
typedef pair<int,int> pii;
typedef complex<double> P;
typedef pair<P,P> Rect;

bool EQ(double a,double b){
  return abs((a)-(b))<EPS;
}
void fast_stream(){
  std::ios_base::sync_with_stdio(0);
}

const int INF=1000000000;
int N;

class Event{
public:
  double y;
  bool isIn;
  int id;
  Event(){}
  Event(double y_,bool isIn_,int id_){
    y=y_;
    isIn=isIn_;
    id=id_;
  }
  bool operator<(const Event& e)const{
    return e.y>this->y; 
  }
};
Event evs[1001];
Rect recs[1001];

class UnionFindTree{
public:
  vector<int> par;
  vector<int> rank;
  vector<double> ls,rs;
  int treeSize;
public:
  UnionFindTree(int initTreeSize = 1000){
    treeSize = initTreeSize;
    init();
  }
  void init(){
    for(int i = 0; i < treeSize; i++){
      par.push_back(i);
      rank.push_back(0);
      ls.push_back(0);
      rs.push_back(0);
    }
  }
  int find(int x){  
    if(par[x] == x)return x;
    else return par[x] = find(par[x]);
  }
  void unite(int x,int y,double l,double r){
    x = find(x);
    y = find(y);
    if(x == y)return;
    if(rank[x] < rank[y])par[x] = y;
    else{
      par[y] = x;
      if(rank[y] == rank[x])rank[x]++;
    }
    int p=find(x);
    ls[p]=l;
    rs[p]=r;
  }
  bool same(int x,int y){
    return find(x) == find(y);
  }
};

int main(){
  int cnt=0;
  while(cin>>N&&N){
    int NN=0;
    for(int i=0;i<N;i++){
      double x,y,r;
      cin>>x>>y>>r;
      recs[i].first=P(x-r,y-r);
      recs[i].second=P(x+r,y+r);
      if(EQ(r,0))continue;
      evs[2*NN]=Event(y-r,true,i);
      evs[2*NN+1]=Event(y+r,false,i);
      NN++;
    }
    sort(evs,evs+2*NN);
    double prvy=-INF;
    double sumLen=0;
    double res=0;
    vector<int> v;
    for(int k=0;k<2*NN;k++){
      Event &e=evs[k];
      if(!EQ(prvy,-INF))res+=sumLen*(e.y-prvy);
      prvy=e.y;
      if(e.isIn)v.push_back(e.id);
      else v.erase(find(v.begin(),v.end(),e.id));
      UnionFindTree uft(v.size());
      for(int i=0;i<v.size();i++){
	uft.ls[i]=recs[v[i]].first.real();
	uft.rs[i]=recs[v[i]].second.real();
      }
      for(int i=0;i<v.size();i++){
	for(int j=i+1;j<v.size();j++){
	  int pari=uft.find(i);
	  int parj=uft.find(j);
	  if((EQ(uft.rs[pari],uft.ls[parj])
	      ||(uft.rs[pari]>uft.ls[parj]))
	     &&(EQ(uft.ls[pari],uft.rs[parj])
		||(uft.ls[pari]<uft.rs[parj]))){
	    double minx=min(uft.ls[pari],uft.ls[parj]);
	    double maxx=max(uft.rs[pari],uft.rs[parj]);
	    uft.unite(i,j,minx,maxx);
	  }
	}
      }
      set<int> s;
      for(int i=0;i<v.size();i++)
	s.insert(uft.find(i));
      sumLen=0;
      for(set<int>::iterator it
	    =s.begin();it!=s.end();it++){
	sumLen+=(uft.rs[*it]-uft.ls[*it]);
      }
    }
    cnt++;
    printf("%d %.2f\n",cnt,res);
  }

  return 0;
}