Write a program that reads
consonants and
vowels, and prints all the words that can be made up by using each
letter exactly once. The words must begin with a consonant, and
alternate consonants and vowels. In this exercise, we will assume that
‘y’ is a vowel.
Input consists of a natural number between 1 and 6, followed by different consonants and different vowels. Both consonants and vowels are given in alphabetical order.
Print the words that can be made up with the given letters, starting with a consonant and always alternating consonants and vowels. Print the words in alphabetical order, one per line.
Input
3 mpt aeo
Output
mapeto mapote matepo matope mepato mepota metapo metopa mopate mopeta motape motepa pameto pamote patemo patome pemato pemota petamo petoma pomate pometa potame potema tamepo tamope tapemo tapome temapo temopa tepamo tepoma tomape tomepa topame topema
Input
2 cs ao
Output
caso cosa saco soca
Input
1 b y
Output
by