#C9217. Reverse Letters in Each Word

    ID: 53286 Type: Default 1000ms 256MiB

Reverse Letters in Each Word

Reverse Letters in Each Word

You are given a string containing letters and spaces. Your task is to reverse the letters in every individual word while preserving the original positions of the spaces. In other words, each maximal sequence of non-space characters should be reversed, but the spaces (including multiple consecutive spaces) must remain unchanged.

For example, given the input "hello world", you should output "olleh dlrow". Similarly, " hello world " should be transformed to " olleh dlrow ".

Note: Treat each word as a contiguous block of non-space characters. The transformation does not affect the spaces.

Mathematically, if a word is represented as $w = c_1c_2\ldots c_n$, then its transformed version is $w' = c_n c_{n-1}\ldots c_1$.

inputFormat

The input consists of a single line which represents the string to be transformed. The string may contain spaces, and spaces should be preserved in their original positions.

outputFormat

Output a single line: the transformed string after reversing the letters of each word while preserving all space positions.

## sample
hello
olleh