Under construction

Still being built. Things may change

Old English

Interview

Time limit1sMemory limit1024 MB

Summary
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 s that is not the first letter of the word and is not followed by h is replaced with th.
  • If the first letter of the word is e, it is replaced with ae.
  • The pair oo is replaced with ou. If three or more o letters 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 nn, the number of words to translate (1≤n≤1001 \le n \le 100). Each of the next nn 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 nn 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.

Examples1

  1. Example 1

    Input
    3
    soon
    English
    this
    
    Expected output
    soun
    Aenglish
    thith