#C13234. Reverse Each Word

    ID: 42750 Type: Default 1000ms 256MiB

Reverse Each Word

Reverse Each Word

You are given a string S. Your task is to reverse each individual word in S while keeping the order of the words intact.

A word is defined as a maximal sequence of non-space characters. Even if there are multiple spaces between words, they should be treated as a delimiter and not preserved; the output should have a single space between reversed words.

For example, if S = "Hello World", then the output should be "olleH dlroW".

Note: Punctuation marks and symbols are considered part of the word. Also, if the input string is empty, the output should also be an empty string.

Mathematically, if a word is represented by a sequence of characters \(w_1w_2\dots w_k\), then its reversed form is given by \(w_k\dots w_2w_1\).

inputFormat

The input consists of a single line containing the string S. The string may contain spaces, punctuation, or even be empty.

The input is provided via standard input (stdin).

outputFormat

Output a single line containing the resulting string after each word in the input has been reversed.

The output should be printed to standard output (stdout).

## sample
Hello World
olleH dlroW