Professor Charles Xavier was designing a class diagram for the mutants in his school of gifted youngsters. He created a class named 'Mutant' which has 4 sub-categories. Each Mutant has one or more 'Ability'.
Everything was going fine until he heard a loud noise and found out that Jean Gray went rogue. He completed some of the classes but had no choice but to leave immediately to deal with the issue. But he felt relieved that he hired you as a mutant specialist last week and also sent you a text to complete the rest of the classes. Could you please help the professor while he is away?
Input
Input starts with an integer n (1 ≤ n ≤ 100).
Each of the next n lines contains a mutant name, mutant class and a list of abilities. Assume that none of the names have spaces, spaces will be converted to underscores.
Output
Your job is to complete implmenting all the classes and also print the following stats:
1) For each mutant class, print the class name in a single line. And then print all the Mutant names in a single line separated by a space. The mutants names should be sorted alphabetically. 2) For each Ability, print the ability and the number of mutants that have that ability in a single line separated by a space. The abilities should be printed in the same order as shown in the diagram.
See the samples for details.
Sample
Sample Input | Sample Output |
---|---|
6 Spider_Man Epsilon_Mutant Unique_Physiology Transportation Superhuman_Attributes Wolverine Beta_Mutant Bone_Protrusions Unique_Physiology Rogue Alpha_Mutant Transformation Tatsumaki Omega_Mutant Transportation Elemental_Abilities Storm Omega_Mutant Superhuman_Attributes Nightcrawler Beta_Mutant Transportation | Alpha_Mutant: Rogue Beta_Mutant: Nightcrawler, Wolverine Epsilon_Mutant: Spider_Man Omega_Mutant: Storm, Tatsumaki Bone_Protrusions: 1 Elemental_Abilities: 1 Mental_Abilities: 0 Superhuman_Attributes: 2 Transformation: 1 Transportation: 3 Unique_Physiology: 2 |