#K53072. Reverse Words in a Sentence

    ID: 29450 Type: Default 1000ms 256MiB

Reverse Words in a Sentence

Reverse Words in a Sentence

Given a string composed of words separated by spaces, your task is to reverse each individual word while keeping the sequence of words unchanged. Formally, if the input string is \(S = w_1\, w_2\, \dots\, w_n\) where each \(w_i\) is a word, then the output should be \(w'_1\, w'_2\, \dots\, w'_n\) where \(w'_i\) is the reversed string of \(w_i\). For example, for the input "Hello World", the output is "olleH dlroW".

Note that punctuation and special characters are treated as part of a word. An empty string should return an empty string.

inputFormat

The input consists of a single line containing a string \(S\). The string may contain spaces, letters, digits, and punctuation. The length of \(S\) is between 0 and 105.

outputFormat

Output a single line containing the modified string where each word in the input is reversed but the order of words remains unchanged.

## sample
Hello World
olleH dlroW