~/algor $ cat problems/string-sozlarni-teskari
Words in reverse order
Easy
1000 ms
128 MB
33%
A text $s$ of lowercase Latin letters and spaces is given. Write the words of the text in reverse order without changing the words themselves. Words are separated by a single space.
Input
One line containing the string $s$.
Output
One line with the words in reverse order, separated by single spaces.
Note
$1 \le |s| \le 10^{5}$
$s$ consists of lowercase Latin letters and spaces
$s$ does not start or end with a space, and words are separated by exactly one space
Examples
Input #1
men algor da organaman
Output #1
organaman da algor men
Input #2
salom
Output #2
salom