In the land of Matriarchia, lineages are traced only through the mothers. Women derive their status from their female family relations and the only relationships that matter are mother, daughter, sister and cousin. Every woman has one mother. A woman is sister to another woman if they have the same mother. A woman is cousin to another woman if they are not sisters and their mothers have the same mother.
The input will contain an integer
The list of mother-daughter pairs will be followed by
Sample Input
19
Jenna Breanna
Jacklyn Sophie
Tanisha Jenna
Jacklyn Emily
Jacklyn Lindsey
Jenna Kailee
Justina Malia
Kailee Hillary
Kailee Myranda
Jenna Shayna
Justina Tatiana
Jenna Raquel
Kailee Mary
Justina Mayra
Tanisha Yasmeen
Jacklyn Darian
Justina Destiny
Jenna Jacklyn
Tanisha Justina
Breanna
Darian
Destiny
Malia
Mary
Mayra
Raquel
Tatiana
Sophie
Myranda
Sample Output
Cousins: 4, Sisters: 4
Cousins: 3, Sisters: 3
Cousins: 5, Sisters: 3
Cousins: 5, Sisters: 3
Cousins: 4, Sisters: 2
Cousins: 5, Sisters: 3
Cousins: 4, Sisters: 4
Cousins: 5, Sisters: 3
Cousins: 3, Sisters: 3
Cousins: 4, Sisters: 2
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments