Old English
InterviewTime limit1sMemory limit1024 MB
Translate each word by replacing s, a leading e, and oo according to three rules while keeping the case of the first letter.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Onufriy is studying Old English. He has homework due tomorrow and no time to learn the grammar in detail, so he decided to apply the following simple rules to turn modern English words into his version of Old English.
- Every letter
sthat is not the first letter of the word and is not followed byhis replaced withth. - If the first letter of the word is
e, it is replaced withae. - The pair
oois replaced withou. If three or moreoletters appear in a row, only the first two are replaced.
Help Onufriy translate several words into his version of Old English.
Input
The first line contains , the number of words to translate (). Each of the next lines contains one word made only of Latin letters. All letters are lowercase, except possibly the first letter, which may be uppercase. Each word is at most 30 characters long.
Output
Print lines, each containing the translated word. If the first letter of the original word was uppercase, the first letter of the translated word must also be uppercase. Otherwise, all letters must stay lowercase.