#include<bits/stdc++.h>
using namespace std;
typedef long long int uli;
struct ival{
   int t;
   double x,yi,yf;
   bool operator <(ival a)const{
      if(x!=a.x)return x<a.x;
      if(yi!=a.yi)return yi<a.yi;
      if(yf!=a.yf)return yf<a.yf;
      return t<a.t;
   }
};
vector<ival>q;
multiset<pair<double,double> >s;
multiset<pair<double,double> >::iterator it;
double len(){
   if(s.empty())return 0;
   double ans=0;
   double lft=s.begin()->first;
   double rht=lft;
   for(it=s.begin();it!=s.end();it++){
      if(it->first>rht){
         ans+=rht-lft;
         lft=it->first;
         rht=it->second;
      }
      else rht=max(rht,it->second);
   }
   ans+=rht-lft;
   return ans;
}
int main(){
   int n,tt=0;
   while(scanf("%d",&n)==1){
      if(n==0)break;
      s.clear();
      q.clear();
      for(int i=0;i<n;i++){
         double xi,yi,r;
         scanf("%lf %lf %lf",&xi,&yi,&r);
         ival ivi={0,xi-r,yi-r,yi+r};
         ival ivf={1,xi+r,yi-r,yi+r};
         q.push_back(ivi);
         q.push_back(ivf);
      }
      sort(q.begin(),q.end());
      double ans=0.0;
      double xi=q[0].x;
      for(int i=0;i<int(q.size());i++){
         ival iv=q[i];
         ans+=(iv.x-xi)*len();
         xi=iv.x;
         if(iv.t==0){
            s.insert(make_pair(iv.yi,iv.yf));
         }
         else{
            it=s.find(make_pair(iv.yi,iv.yf));
            s.erase(it);
         }
      }
      printf("%d %.2lf\n",++tt,ans);
   }
   return 0;
}