In the first line there is written one positive integer n <= 1000.
This is the number of generators.
In the (i + 1)?st line (for i = 1,..., n) there is written an integer ki
followed by all the elements of the set Si (written in arbitrary order).
The integers in each line are separated by single spaces.