Problem C

The Simpson Tree

As you may remember, Marge Simpson once became a spectacle during a parent teachers association meeting for not having an e-mail address. After that meeting, she decided to take a chance on using the Internet. Soon, Marge got bitten by the information highway bug. As soon as Bart, Lisa, Maggie and Homer were all asleep, Marge would get out of bed, sneak down the stairs, sit on the couch, open her laptop and enter the Internet.

Recently, Marge got interested in her family tree. Using her favourite word processor Notepad, Marge collected part of her family tree (the second and third line of the sample input provided below are part of her file). However, this file does not give her an appealing view of her family tree. Can you help Marge?


Source: englishexercises.org

Input

To simplify matters, you may assume that first names are unique. Furthermore, you may also assume that nobody remarries and only couples have children.

The input consists of multiple instances (more than one, less than 1000). Each instance starts with an integer n (1 <= n <= 100). A zero signals the end of the input. The line containing the integer n is followed by n lines. Each line describes a family and has the following format

c p1 p2 c1 c2 ... cn
where c (0 <= c <= 10) is the number of children of the family, p1 and p2 are the names of the parents (each name consisting of 2 to 10 characters) and c1, c2, ..., cn are the names of the n children (each name consisting of 2 to 10 characters). The children are sorted by age, the oldest first.

Output

For each instance, print the family tree. Two examples are provided below. Note that, in the first column, the first parent has a star (Abraham comes before Mona in the sample input and Katherine comes before Joseph). In the remaining columns, the children are starred whereas those who are married to those children are not starred (Toriano is a son of Katherine and Joseph and therefore has a star, whereas Deloris is married to Toriano and hence does not have a star). The different columns are separated by tabs (not spaces).

Sample Input

2
3 Homer Marge Bart Lisa Maggie
2 Abraham Mona Herb Homer
5
2 Taryll Breanna Bryce Adren
3 Michael Debbie Prince Paris Blanket
2 Toriano Deloris Tariano Taryll
10 Katherine Joseph Maureen Sigmund Toriano Jermaine LaToya Marlon Brandon Michael Steven Janet
2 Steven Alejandra Genevieve Randy
0

Sample Output

*Abraham
 Mona
	*Herb
	*Homer
	 Marge
		*Bart
		*Lisa
		*Maggie
*Katherine
 Joseph
	*Maureen
	*Sigmund
	*Toriano
	 Deloris
		*Tariano
		*Taryll
		 Breanna
			*Bryce
			*Adren
	*Jermaine
	*LaToya
	*Marlon
	*Brandon
	*Michael
	 Debbie
		*Prince
		*Paris
		*Blanket
	*Steven
	 Alejandra
		*Genevieve
		*Randy
	*Janet