eolymp
bolt
Try our new interface for solving problems
Problems

Flower-garden Designs

Flower-garden Designs

Time limit 2 seconds
Memory limit 128 MiB

There were n 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 data

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

Output data

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

Input example #1
7
5
1 2
0 0
6 0
0 4
2 7
5
1 2
3 9
0 1
2 3
9 2
5
-43 -37
-73 -47
-3 3
-23 -7
-3 63
3
0 0
1 0
0 1
3
0 0
1 0
3 0
3
10 3
3 7
5 2
3
6 1
6 5
6 7
Output example #1
4
4 6 0
5 7 0
1 3 0
2 0
Author Andrew Rumyantsev
Source 2005 Petrozavodsk Training Camp, August 30