The Bulk

Time limit1sMemory limit128 MB

Problem

A transceiver is assembled from identical unit cubes. Cubes are always joined face to face: a whole side of one cube meets the whole side of another, so a single cube can be attached to at most six others. The resulting body of connected unit cubes is called a bulk.

Old, unneeded bulks are being taken apart into single pieces to save space. There is no documentation, so nobody knows how many cubes a bulk contains. Given a description of a bulk, compute the number of unit cubes it is made of.

Each bulk is described by its faces. A scanner locates every face of the bulk, including inner faces, because a bulk may be partially hollow (it may enclose empty space inside). A bulk is always connected (it never splits into two pieces) and is composed of whole unit cubes.

Input

The first line contains a single positive integer $T$, the number of bulks that follow.

Each bulk begins with a line containing one integer $F$ ($6 \le F \le 250$), the number of faces, followed by $F$ lines that describe the faces in any order. All faces of the bulk are listed. Any face may be divided into several separate parts, each written as if it were its own face; faces never overlap. Every face has one inner side and one outer side, and no side is partly inner and partly outer.

Each face is given on one line. The line starts with an integer $P$ ($4 \le P \le 200$), the number of vertices, followed by $3P$ integers: the coordinates $X;Y;Z$ of each vertex, with $0 \le X, Y, Z \le 1000$, separated by spaces. The face is the closed polygon formed by connecting the vertices in the given order and joining the last vertex back to the first.

Every face is made of unit squares, so each edge runs parallel to the $X$, $Y$, or $Z$ axis: any two consecutive vertices differ in exactly one coordinate. Every face lies in an axis-orthogonal plane, meaning exactly one coordinate is the same for all of its vertices. A face outline never touches or crosses itself.

Output

For each bulk, print a single line The bulk is composed of V units., where $V$ is the volume of the bulk (the number of unit cubes it contains).