Flower-garden Designs#4963

Flower-garden Designs

2 seconds
128 megabytes
Very hard

There were people to take part in the competition for a flower-garden design. Each of them had proposed his design, the finite sequence of points in plane which are the suggested locations for flowers. To save the main jury from needless labor of considering identical designs, the pre-jury wants to find the designs which only differ in rearrangement of points and their affine transformation that doesn't change the orientation (that is, the radius-vector of each point is multiplied by a matrix with positive determinant and translated by a fixed vector).

Input

The first line contains the single number (n \le 10000). The designs follow. Each design is represented as the length of the sequence , followed by coordinates of points ( pairs of integers whose absolute value doesn't exceed , each pair on a line by itself). The sum of all sequences' lengths doesn't exceed .

Output

The first line of output must contain the number of different design classes. The following lines must list the classes as one-based indices of designs, terminated with zero.

Examples

Example 1

Loading
Loading