Problem: Santa Claus has received letters from different kids throughout this year. Of course, each kid wants to get some presents from Santa: in particular, the -th kid asked Santa to give them one of different items as a present. Some items could have been asked by multiple kids.
Santa is really busy, so he wants the New Year Bot to choose the presents for all children. Unfortunately, the Bot's algorithm of choosing presents is bugged. To choose a present for some kid, the Bot does the following:
- choose one kid equiprobably among all kids;
- choose some item equiprobably among all items kid wants;
- choose a kid who will receive the present equipropably among all kids (this choice is independent of choosing and ); the resulting triple is called the decision of the Bot.
If kid listed item as an item they want to receive, then the decision valid. Otherwise, the Bot's choice is invalid.
Santa is aware of the bug, but he can't estimate if this bug is really severe. To do so, he wants to know the probability that one decision generated according to the aforementioned algorithm is valid. Can you help him?
Input Format: The first line contains one integer () — the number of kids who wrote their letters to Santa.
Then lines follow, the -th of them contains a list of items wanted by the -th kid in the following format: ... (), where is the number of items wanted by the -th kid, and are the items themselves. No item is contained in the same list more than once.
It is guaranteed that .
Output Format: Print the probatility that the Bot produces a valid decision as follows:
Let this probability be represented as an irreducible fraction . You have to print , where is the inverse element of modulo (such integer that has remainder modulo ).