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

public class kingdom_al {
  static Scanner in;
  static final int MaxN = 30, MaxM = 30, MaxC = 1000;


  static void rangeInt (int r, int a, int b) throws Exception {
    if (r < a || r > b)
      error ("ERROR IN TEST: Expected integer between " + a + " and " + b +", found " + r);
  };

  static int rangeInt (int a, int b) throws Exception {
    int r = in.nextInt ();
    rangeInt (r, a, b);
    return r;
  };

  static void error (String s) throws Exception {
    throw new RuntimeException (s);
  };

  static int sqr (int x) {
    return x * x;
  };

  public static void main (String args []) throws Exception {
    in = new Scanner (new File ("kingdom.in"));
    PrintWriter out = new PrintWriter (new File ("kingdom.out"));
    int n = rangeInt (1, MaxN);
    int [] m = new int [n];
    int [][] x = new int [n][], y = new int[n][], r = new int [n][];
    double [] ar = new double [n];
    for (int i = 0; i < n; i++) {
      m[i] = rangeInt (1, MaxM);
      x[i] = new int [m[i]];
      y[i] = new int [m[i]];
      r[i] = new int [m[i]];
      for (int j = 0; j < m[i]; j++) {
        x[i][j] = rangeInt (-MaxC, MaxC);
        y[i][j] = rangeInt (-MaxC, MaxC);
        r[i][j] = rangeInt (1, MaxC);
        ar[i] += sqr (r[i][j]);
        for (int k = 0; k < j; k++)
          if (sqr (x[i][j] - x[i][k]) + sqr (y[i][j] - y[i][k]) < sqr (r[i][j] + r[i][k]))
            error ("Circles " + j + " and " + k + " for kingdom " + i + " intersect");
      };
      ar[i] *= Math.PI;
    };
    boolean [] f = new boolean [n];
    double [] yb = new double [n], ye = new double [n];
    double yc = -2000;

    double [] p = new double [n], q = new double [n];
    for (int i = 0; i < n; i++) {
      double ll = yc, rr = 2000, t = -12345;
      int mj = -1;
      for (int cc = 0; cc < 60; cc++) {
        t = (ll + rr) * 0.5;
        double mx = -1;
        mj = -1;
        for (int j = 0; j < n; j++)
          if (!f[j]) {
            p[j] = 0;
            for (int k = 0; k < m[j]; k++) {
              if (t < y[j][k]) {
                if (t > y[j][k] - r[j][k]) {
                  double v = (y[j][k] - t) / r[j][k];
                  double ang = 2 * Math.acos (v);
                  double S = 0.5 * sqr (r[j][k]) * (ang - Math.sin (ang));
                  p[j] += S / ar[j];
                };
              } else {
                if (t < y[j][k] + r[j][k]) {
                  double v = (t - y[j][k]) / r[j][k];
                  double ang = 2 * Math.acos (v);
                  //System.out.println (ang);
                  double S = 0.5 * sqr (r[j][k]) * (2 * Math.PI - (ang - Math.sin (ang)));
                  p[j] += S / ar[j];
                } else p[j] += sqr (r[j][k]) * Math.PI / ar[j];
              };
            };
            //System.out.println (j + " " + t + " " + p[j]);
            if (p[j] - q[j] > mx) {
              mx = p[j] - q[j];
              mj = j;
            };
          };
        if (mx > 1.0 / n) rr = t; else ll = t;
        //System.out.println (ll + " " + rr);
        //for (int j = 0; j < n; j++) System.out.println (t + " " + j + " " + p[j]);
      };
      f[mj] = true;
      yb[mj] = yc;
      ye[mj] = t;
      yc = t;
      for (int j = 0; j < n; j++) q[j] = p[j];
      //for (int j = 0; j < n; j++) System.out.println (j + " " + q[j]);
    };
    for (int i = 0; i < n; i++) {
      out.println (4);
      out.println ("-2000 " + yb[i]);
      out.println ("-2000 " + ye[i]);
      out.println ("2000 " + ye[i]);
      out.println ("2000 " + yb[i]);
    };
    //out.println ("Not implemented yet... in progress. Test is correct.");
    out.close ();
  };
};
