Reversing Words

No attempts yetTime limit1sMemory limit128 MB

Problem

Reverse each word on its own, not the sentence around it. Only the letters move: spaces, punctuation and the pattern of capitals stay where they are.

A word here is a sequence of characters that contains at least two letters and is delimited by whitespace. The letters of a word are written in reverse order, so 'the' becomes 'eht', while every other character of the word keeps its original position. If a character of the original word is upper case, the letter in the same position of the new word is upper case too, so 'Smith-Jones' becomes 'Senoj-Htims'. The position of a word inside its line does not change, and neither does the position of any non-letter, so a double blank stays a double blank.

A letter is one of A to Z or a to z.

Input

The input is a series of lines and ends with a line that holds a single #. No line is longer than 80 characters. That final line marks the end of the input and is not processed.

Output

For every input line before the terminating line, print one line with the letters of each word reversed as described above.