Reverse the Order of Words
Print the words of a line in reverse order.
Input format
A single line S of words separated by single spaces.
Output format
Print the words of S in reverse order, separated by single spaces.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
the sky is blueExpected output
blue is sky theExample 2
Input
hello worldExpected output
world hello