Jay runs a carnival maze made of circular rooms linked by narrow, twisty corridors. Rooms A and B are effectively identical if, knowing the full map, an explorer dropped into A or B cannot tell which room they started in. Corridor exits are evenly spaced around each room, nothing can be marked inside a room, and corridors look the same. The only cues are the number of exits and, after entering through one corridor, the clockwise order of the other exits. Print every maximal set of effectively identical rooms.
A single test case. The first line contains n (1≤n≤100), the number of rooms numbered from 1 to n. Each of the next n lines describes one room: an integer k (0≤k<100), the number of corridors, followed by k distinct room numbers listed in clockwise order from an arbitrary starting exit. No room connects to itself.
For each maximal set of effectively identical rooms with size at least 2, print the room numbers in increasing order on one line. Order the lines by the smallest room number in each set. If no such set exists, print none.