Reverse Words in a String
Given a string with words separated by spaces, reverse the order of the words.
Input format
A single line containing words separated by single spaces.
Output format
Print the words 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
helloExpected output
hello