Test 

Statistical analysis quite often involves questions whether differences between samples are meaningful. Lack of meaningful differences indicates that the samples do not differ with respect to studied feature. The bigger the number of samples the bigger are troubles we find ourselves in, because it is much more difficult then to delimit sets of non-differing samples.


Let's assume we have three samples P1, P2, P3. We also know that P1 differs meaningfully from P2, but others do not differ. Thus we have two sets of samples not different meaningfully. First one contains P1 and P3 (because they it is not stated that they differ meaningfully) and respectively the second one contains P2 and P3 (similar as earlier).

As you can see these sets are not separate. It is going to be handy to denote the belonging to the set with a character associated with it. In our case we have: P1:a P2:b P3:ab.


Conclusions:

Your task is to write a program which delimits sets without meaningful differences.

Input 

A number (n) of samples in the first line, in ``n" consecutive ones an incidence matrix which describes the differences between samples is given. The actual information in the matrix is given above the primary diagonal. Symbol `*' depicts meaningful differences, symbol `-' depicts no meaningful differences.

Output 

For each matrix ``n" lines (each representing one sample) enumerating sets to which the sample belongs, and then a line with 5 hyphens.


Assumptions: Number of samples in one test does not exceed 10. The most numerous set acquires the character ``a", the second in the line ``b" etc. In case of sets having the same number of elements the first one goes the one which contains a sample of lower number.

Sample Input 

3
-*-
---
---
3
-**
--*
---
3
---
---
---
4
----
--**
---*
----
9
---*--*--
-----*---
------*--
---------
-------*-
--------*
---------
---------
---------

Sample Output 

a
b
ab
-----
a
b
c
-----
a
a
a
-----
abc
a
b
c
-----
abgh
abcdef
abcdghij
cdefijkl
acegik
ghijkl
efkl
bdfhjl
abcdef
-----



Miguel A. Revilla
2000-01-10