/*--------------------------------------------------------------*/
/* ACM ICPC 2007-2008                                           */
/* Northeastern European Regional Contest                       */
/* St Petersburg - Barnaul - Tashkent - Batumi, November 28, 200*/
/*--------------------------------------------------------------*/
/* Problem K. Kingdom Partitioning                              */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Roman Satyukov                         */
/*--------------------------------------------------------------*/
 
import java.io.*;
import java.util.*;

public class kingdom_rs implements Runnable {
    private BufferedReader in;
    private PrintWriter out;
    private static final int MAX_COORDINATE = 3000;
    
    private class Kingdom {
        private int n;
        private int[] x, y, r;
        public double area;

        public Kingdom(int n) {
            this.x = new int[n];
            this.y = new int[n];
            this.r = new int[n];
            this.area = 0;
            this.n = 0;
        }

        public void addCircle(int x, int y, int r) {
            this.x[n] = x; 
            this.y[n] = y; 
            this.r[n] = r;
            area += Math.PI * r * r;
            n++;
        }
        
        public double calcAreaAbove(double border) {
            double result = 0.0;
            for (int i = 0; i < n; i++) {
                if (y[i] - r[i] > border) {
                    result = result + Math.PI * r[i] * r[i];
                    continue;
                } else if (y[i] + r[i] < border) {
                    continue;
                }
                double dist = Math.abs(y[i] - border);
                double addon = 0;
                if (y[i] > border) {
                    double cosa = dist / r[i];
                    double alpha = Math.acos(cosa);
                    addon = (Math.PI - alpha) * r[i] * r[i] + dist * Math.sqrt(r[i] * r[i] - dist * dist);
                } else {
                    double cosa = dist / r[i];
                    double alpha = Math.acos(cosa);
                    addon = alpha * r[i] * r[i] - dist * Math.sqrt(r[i] * r[i] - dist * dist);
                }
                result = result + addon;
            }
            return result;
        }
    }
    
    private void solve() throws IOException {
        Locale.setDefault(Locale.US);
        int n = Integer.parseInt(in.readLine());
        Kingdom[] kingdoms = new Kingdom[n];
        for (int i = 0; i < n; i++) {
            int m = Integer.parseInt(in.readLine());
            kingdoms[i] = new Kingdom(m);
            for (int j = 0; j < m; j++) {
                StringTokenizer st = new StringTokenizer(in.readLine());
                int x = Integer.parseInt(st.nextToken());
                int y = Integer.parseInt(st.nextToken());
                int r = Integer.parseInt(st.nextToken());
                kingdoms[i].addCircle(x, y, r);
            }
        }
        double currentBorder = -MAX_COORDINATE;
        boolean[] mark = new boolean[n];
        double[] ansx = new double[n];
        double[] ansy = new double[n];
        for (int i = 0; i < n; i++) {
            double newBorder = MAX_COORDINATE;
            int owner = -1;
            for (int j = 0; j < n; j++) {
                if (mark[j]) {
                    continue;
                }
                double neededArea = kingdoms[j].area / n;
                double leftArea = kingdoms[j].calcAreaAbove(currentBorder);
                double low = 0;
                double hi = MAX_COORDINATE - currentBorder;
                while (true) {
                    double middle = (low + hi) / 2;
                    if (low == middle || middle == hi || low == hi) {
                        break;
                    }
                    double areaAbove = kingdoms[j].calcAreaAbove(currentBorder + middle);
                    if (leftArea - areaAbove < neededArea) {
                        low = middle;
                    } else {
                        hi = middle;
                    }
                }
                if (currentBorder + low < newBorder) {
                    newBorder = currentBorder + low;
                    owner = j;
                }
            }
            mark[owner] = true;
            ansx[owner] = currentBorder; 
            ansy[owner] = newBorder;
            currentBorder = newBorder;
        }
        for (int i = 0; i < n; i++) {
            out.println(4);
            out.println(-MAX_COORDINATE + " " + ansx[i]);
            out.println(MAX_COORDINATE + " " + ansx[i]);
            out.println(MAX_COORDINATE + " " + ansy[i]);
            out.println(-MAX_COORDINATE + " " + ansy[i]);
        }
    }
    
    public static void main(String[] args) {
        new Thread(new kingdom_rs()).start();
    }

    public void run() {
        String problem = getClass().getName().split("_")[0];
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
