#include<iostream>
#include<iomanip>
#include<vector>
#include<set>
using namespace std;

class Square {
public:
    Square(double x, double y, double r) :x_(x), y_(y), r_(r) {}

    double left() const {return x_ - r_;}
    double right() const {return x_ + r_;}
    double bottom() const {return y_ - r_;}
    double top() const {return y_ + r_;}

private:
    double x_, y_, r_;
};

int main() {
    int step = 0;
    int n;
    while(cin >> n, n) {
        vector<Square> square;
        set<double> line;
        for(int i = 0; i < n; ++i) {
            double x, y, r;
            cin >> x >> y >> r;
            square.push_back(Square(x, y, r));
            line.insert(x - r);
            line.insert(x + r);
        }

        double answer = 0.0;
        double previous_x = 0.0;
        double previous_distance = 0.0;

        for(const auto& l: line) {
            const bool IN = true;
            const bool OUT = false;
            struct Node {
                double y;
                bool in;
                Node(double y, bool b) :y(y), in(b) {}
                bool operator<(const Node& n) const {return y != n.y ? y < n.y : in > n.in;}
            };

            answer += previous_distance * (l - previous_x);
            previous_x = l;
            previous_distance = 0.0;

            multiset<Node> node;
            for(const auto& s: square) {
                if(s.right() <= l || l < s.left()) continue;
                node.insert(Node(s.bottom(), IN));
                node.insert(Node(s.top(), OUT));
            }
            double y;
            int in = 0;
            for(const auto& n: node) {
                if(in == 0) y = n.y;
                previous_distance += n.y - y;
                y = n.y;
                in += n.in ? 1 : -1;
            }
        }

        cout << setprecision(2) << fixed << ++step << " " << answer << endl;
    }
}