Your task is to write a program that reads consonants and vowels, and that prints all the words that can be formed using exactly once each one of the given letters. The words have to start in consonant, and must alternate consonants and vowels.
The input consists of a natural between 1 and 5, followed by different consonants and different vowels. The consonants as well as the vowels are given in alphabetical order.
Your program must print all the words that can be formed with the given letters, starting in consonant and alternating consonants and vowels. The words must be written in alphabetical order, one per line. Logically, it is not necessary that the generated words have any meaning.
Author: Salvador Roura
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 u
Output
bu