#C5433. Reverse the Order of Words

    ID: 49082 Type: Default 1000ms 256MiB

Reverse the Order of Words

Reverse the Order of Words

In this problem, you are provided a string S containing multiple words separated by spaces. Your task is to reverse the order of words in S. More formally, if \(S = w_1 w_2 \ldots w_n\) (where \(n \ge 1\)) then you must output \(S' = w_n \ldots w_2 w_1\). The words themselves should remain unchanged. Please note that extra spaces at the beginning or end of the input should be handled gracefully, and multiple spaces between words should be treated as a single separator.

inputFormat

The input is given via stdin. It consists of a single line containing the string S, which may include multiple words separated by spaces.

outputFormat

The output should be written to stdout. Print a single line representing the string S with its words in reverse order. Words should be separated by a single space.

## sample
hello
hello