Problem 831
Goat Latin
Easy · 10 pts · String
Problem
Convert a sentence to Goat Latin, word by word. If a word starts with a vowel (a, e, i, o, u in either case), append ma to it. Otherwise, move its first letter to the end and then append ma. Finally, add one letter a to the end of the first word, two to the second word, and so on. Print the converted words separated by single spaces.
Input
The first line contains N. The second line contains the N words of the sentence (English letters).
Output
Print the sentence in Goat Latin.
Constraints
1 <= N <= 150; 1 <= |word| <= 10
Example input
4 I speak Goat Latin
Example output
Imaa peaksmaaa oatGmaaaa atinLmaaaaa
Explanation
For I speak Goat Latin: I starts with a vowel and becomes Imaa; speak becomes peaksmaaa; Goat becomes oatGmaaaa; Latin becomes atinLmaaaaa.