{$O-,Q+,R+}
{$APPTYPE CONSOLE}
uses testlib, SysUtils, Math;

type integer = longint;

const eps1 = 1.1e-7;
      eps2 = 1.1e-3;
      eps3 = 1e-16;

const MaxVP = 1000;
      MaxCP = 3000;
      MaxN = 30;
      MaxM = 30;

var px, py : array [1..MaxN, 0..MaxVP + 1] of extended;
    pc, sp : array [1..MaxN] of integer;

function getside (z : integer; a, b, c : extended) : integer;
var val : extended;
    sg, i : integer;
begin
  sg := 0;
  Result := 2;
  for i := 1 to pc[z] do begin
    val := a * px[z, i] + b * py[z, i] + c;
    if (val < -eps2) then begin
      if sg = 1 then exit;
      sg := -1;
    end else
    if (val > eps2) then begin
      if sg = -1 then exit;
      sg := 1;
    end;
  end;
  Result := sg;
end;


function segment (x1, y1, x2, y2 : extended; r, sg : integer) : extended;
var a1, a2, a : extended;
begin
  a1 := arctan2 (y1, x1); a2 := arctan2 (y2, x2);
  if sg > 0 then a := a2 - a1 else a := a1 - a2;
  if a < -eps3 then a := a + 2 * pi;

  if a < pi then Result := r * r * 0.5 * (a - sin (a)) else begin
    a := 2 * pi - a;
    Result := r * r * 0.5 * (a - sin (a));
    Result := pi * r * r - Result;
  end;
end;

var n : integer;
    m : array [1..MaxM] of integer;
    x, y, r : array [1..MaxN, 1..MaxM] of integer;

    zx, zy : array [0..MaxVP * 5] of extended;
    zt : array [0..MaxVP * 5] of integer;
    zc : integer;


procedure answer (var f : instream);
var i, j, k, sg, s1, s2, mode, bm : integer;
    ang, a, b, c, S, D, dx, dy, t, t1, t2, de, sum, total, x1, y1, x2, y2, cur : extended;
    found : boolean;
begin
  for i := 1 to n do begin
    pc[i] := f.readlongint;
    for j := 1 to min (pc[i], MaxVP) do begin
      px[i, j] := f.readreal;
      py[i, j] := f.readreal;
    end;
    for j := MaxVP + 1 to pc[i] do begin
      f.readreal; f.readreal;
    end;
  end;
  if not f.seekeof then f.quit (_PE, 'End-of-file expected');
  for i := 1 to n do begin
    if (pc[i] < 3) or (pc[i] > MaxVP) then f.quit (_WA, format ('Polygon %d has an invalid number of vertices: %d', [i, pc[i]]));
    for j := 1 to pc[i] do 
      if (px[i, j] < -MaxCP - eps1) or (px[i, j] > MaxCP + eps1) or
         (py[i, j] < -MaxCP - eps1) or (py[i, j] > MaxCP + eps1) then
        f.quit (_WA, format ('Coordinates of vertex %d of polygon %d are outside required area: (%.5f, %.5f)',
          [j, i, px[i, j], py[i, j]]));
    px[i, 0] := px[i, pc[i]];
    py[i, 0] := py[i, pc[i]];
    px[i, pc[i] + 1] := px[i, 1];
    py[i, pc[i] + 1] := py[i, 1];
    sg := 0;
    for j := 1 to pc[i] do begin
      ang := (px[i, j] - px[i, j - 1]) * (py[i, j + 1] - py[i, j]) - 
             (px[i, j + 1] - px[i, j]) * (py[i, j] - py[i, j - 1]); //death of checker guaranteed here
      if ang < -eps2 then begin
        if sg > 0 then f.quit (_WA, format ('Non-convex polygon %d', [i]));
        sg := -1;
      end else 
      if ang > eps2 then begin
        if sg < 0 then f.quit (_WA, format ('Non-convex polygon %d', [i]));
        sg := 1;
      end else
      f.quit (_WA, format ('three points on one line in polygon %d: (%.5f, %.5f); (%.5f, %.5f); (%.5f, %.5f)',
        [i, px[i, j - 1], py[i, j - 1], px[i, j], py[i, j], px[i, j + 1], py[i, j + 1]]));
    end;
    sp[i] := sg;
    //writeln (sg);
  end;
  for i := 1 to n do
    for j := i + 1 to n do begin
      found := false;
      for k := 1 to pc[i] do begin
        a := py[i, k] - py[i, k - 1];
        b := px[i, k - 1] - px[i, k];
        c := -(a * px[i, k] + b * py[i, k]);
        s1 := getside (i, a, b, c);
        s2 := getside (j, a, b, c);
        if (s1 = 2) or (s1 = 0) or (s2 = 0) then f.quit (_fail, 'fatal precision loss in checker');
        if s1 = -s2 then begin
          found := true; break
        end;
      end;
      if not found then begin
        for k := 1 to pc[i] do begin
          a := py[j, k] - py[j, k - 1];
          b := px[j, k - 1] - px[j, k];
          c := -(a * px[j, k] + b * py[j, k]);
          s1 := getside (j, a, b, c);
          s2 := getside (i, a, b, c);
          if (s1 = 2) or (s1 = 0) or (s2 = 0) then f.quit (_fail, 'fatal precision loss in checker');
          if s1 = -s2 then begin
            found := true; break
          end;
        end;
      end;
      if not found then f.quit (_WA, format ('polygons %d and %d intersect', [i, j]));
    end;
  for i := 1 to n do begin
    sum := 0; total := 0;
    for j := 1 to m[i] do begin
      total := total + pi * sqr (r[i, j]);

      cur := 0;

      zc := 0;
      for k := 1 to pc[i] do begin
        if sqr (px[i, k] - x[i, j]) + sqr (py[i, k] - y[i, j]) < sqr (r[i, j]) + 5 * eps1 then begin
          inc (zc);
          zx[zc] := px[i, k] - x[i, j];
          zy[zc] := py[i, k] - y[i, j];
          zt[zc] := 0;
        end;
        dx := px[i, k + 1] - px[i, k];
        dy := py[i, k + 1] - py[i, k];
        a := dy;
        b := -dx;
        c := a * (px[i, k] - x[i, j]) + b * (py[i, k] - y[i, j]);
        S := sqr(a) + sqr(b);
        D := sqr(r[i, j])*S - sqr(c);
        if D > -eps2 then begin
          if D < 0 then D := 0;
          t := sqrt (D);
          x1 := (a * c + b * t) / S;
          y1 := (b * c - a * t) / S;
          x2 := (a * c - b * t) / S;
          y2 := (b * c + a * t) / S;
          assert (abs (a * x1 + b * y1 - c) < eps2);
          assert (abs (a * x2 + b * y2 - c) < eps2);
          assert (abs (sqr (x1) + sqr (y1) - sqr (r[i, j])) < eps2);
          assert (abs (sqr (x2) + sqr (y2) - sqr (r[i, j])) < eps2);
          if abs (dx) > abs (dy) then begin
            t1 := x1 - px[i, k] + x[i, j];
            t2 := x2 - px[i, k] + x[i, j];
            de := dx;
          end else begin
            t1 := y1 - py[i, k] + y[i, j];
            t2 := y2 - py[i, k] + y[i, j];
            de := dy;
          end;
          if de < 0 then begin t1 := -t1; t2 := -t2; de := -de end;
          if t1 > t2 then begin
            t := x1; x1 := x2; x2 := t;
            t := y1; y1 := y2; y2 := t;
            t := t1; t1 := t2; t2 := t;
          end;
          if (t1 > -eps2) and (t1 < de + eps2) then begin
            inc (zc);
            zx[zc] := x1;
            zy[zc] := y1;
            zt[zc] := 1;
          end;
          if (t2 > -eps2) and (t2 < de + eps2) then begin
            inc (zc);
            zx[zc] := x2;
            zy[zc] := y2;
            //writeln (zc, ' ', zt[zc]);
            zt[zc] := -1;
          end;
        end;
      end;

      (*writeln ('intersection of ', i, ' with its circle ', j);
      for k := 1 to zc do
        writeln (zx[k]:0:20, ' ', zy[k]:0:20, ' ', zt[k]);*)

      zx[0] := zx[zc]; zy[0] := zy[zc]; zt[0] := zt[zc];
      zx[zc + 1] := zx[1]; zy[zc + 1] := zy[1]; zt[zc + 1] := zt[1];

      for k := 1 to zc do begin
        cur := cur + (zx[k] * zy[k - 1] - zx[k - 1] * zy[k]) / 2;
      end;

      cur := abs (cur);

      mode := 1; bm := -1;

      for k := 1 to zc + 1 do begin
        case zt[k] of
          -1 : begin mode := -1; bm := k end;
           0 : begin
                 if mode = -1 then begin
                   cur := cur + segment (zx[bm], zy[bm], zx[k], zy[k], r[i, j], sp[i]);
                   bm := k;
                 end;
               end;
           1 : begin
                 if mode = -1 then begin
                   cur := cur + segment (zx[bm], zy[bm], zx[k], zy[k], r[i, j], sp[i]);
                   bm := k;
                 end;
                 mode := 1;
               end;
        end;
      end;
      if cur < eps2 then begin
        //check null area;
        found := true;
        for k := 1 to pc[i] do
          if ((px[i, k] - px[i, k - 1]) * (y[i, j] - py[i, k - 1]) -
              (py[i, k] - py[i, k - 1]) * (x[i, j] - px[i, k - 1])) * sp[i] < -eps2 then begin
            found := false;
            break;
          end;
        if found then begin
          //writeln ('!!! null area inside the polygon');
          cur := pi * r[i, j] * r[i, j];
        end;
      end;
      //writeln (cur);
      sum := sum + cur;
    end;
    if sum < total / n - eps2 then f.quit (_WA, format ('Condition for Kingdom %d is not satisfied', [i]));
    //writeln ('kingdom ', i, '... ', sum / total : 0 : 5);
  end;
end;

var i, j : integer;

begin
  n := inf.readlongint;
  for i := 1 to n do begin
    m[i] := inf.readlongint;
    for j := 1 to m[i] do begin
      x[i, j] := inf.readlongint;
      y[i, j] := inf.readlongint;
      r[i, j] := inf.readlongint;
    end;
  end;

  //answer (ans);
  answer (ouf);
  quit (_OK, inttostr (n) + ' Kingdoms');
end.