Nimions speak a funny form of language.

Whichever word they are trying to say, from which ever language, it doesn’t quite come out the same. There are several rules for converting words, from any language, to nimionese.

For any word:

  • All nimion words start with ‘hard’ consonants (b, c, d, g, k, n, p, t) so you must replace each first letter with the nearest one (choose the option nearest to ‘A’ if there is a tie).

    • “Each” becomes “Dach”.

  • Any hard consonant in subsequent syllables after the first one is remarkably better if it is replaced with the same consonant as the one at the start of the word.

    • “Hip-po” becomes “Gip-go”.

  • No word ends in a hard consonant. You must add an ‘ah’, ‘oh’ or ‘uh’ at the end, whichever is nearest, rounding toward ‘A’ in the case of a tie, to the last hard consonant in the word.

    • “Dog” becomes “Dogah”

    • “Hip” becomes “Gipoh”.


The only line of input contains a sentence of between $1$ and $50$ words and up to $10^4$ symbols, including single whitespace characters (‘ ’) between words and the dashes (‘-’) between each syllable.

Apart from dashes, the sentence will contain solely lower-and-upper-case Latin letters—and only the first letters of words can be upper-case.


Write to standard output the same sentence from the input, translated to nimionese. Remove any dashes before printing.

It is guaranteed that the output will fit within $5 \cdot 10^4$ characters.

Sample Input 1 Sample Output 1
I love ba-na-na
Gah kove bababa
Sample Input 2 Sample Output 2
Sample Input 3 Sample Output 3
Co-ding is the best
Cociccah gs the bestuh
Sample Input 4 Sample Output 4
I rock at co-lour-ing
Gah pockoh btuh colouriccah
CPU Time limit 1 second
Memory limit 1024 MB
Difficulty 2.1easy
Statistics Show
License Creative Commons License (cc by-sa)

Please log in to submit a solution to this problem

Log in