#K33477. Reverse Sentence Order

    ID: 25096 Type: Default 1000ms 256MiB

Reverse Sentence Order

Reverse Sentence Order

Given a sentence ending with a period, reverse the order of its words while preserving the ending period. The input consists of a single line from standard input representing the sentence. It is guaranteed that each sentence ends with a period and words are separated by a single space. Formally, if the sentence contains words w1,w2,,wkw_1, w_2, \dots, w_k, then the output should be wk,wk1,,w1w_k, w_{k-1}, \dots, w_1 with a period at the end.

inputFormat

A single line from standard input containing a sentence. The sentence guaranteed ends with a period, and words are separated by single spaces.

outputFormat

Output the sentence with the order of words reversed but preserving the ending period. The output should be printed to standard output.## sample

hello.
hello.