Recent excavations have revealed an ancient extinct language. Thanks
to the ruins found, experts have deduced that there were vowels and
consonants, and that all words could be formed, with one sole exception:
a word could not have two or more consecutive vowels. For example, with
the two vowels a and e, and consonant
b, 11 words with three letters could be formed:
aba, abb, abe, bab,
bba, bbb, bbe, beb,
eba, ebb, ebe.
Which words of size could be formed with given letters?
Input consists of several cases, each with and , followed by different lowercase letter. It holds that , , and that each case has at least one vowel and one consonant.
For each case, write in lexicographical order all words of length that can be built with the given letters. Write a line with 10 hyphens after each case.
Input
3 3 aeb 1 2 az 3 2 pe
Output
aba abb abe bab bba bbb bbe beb eba ebb ebe ---------- a z ---------- epe epp pep ppe ppp ----------