Problems > Reverse the Word Order

Reverse the Word Order

Difficulty: 900 2000 ms 128 MB

strings

Print the words of the line in reverse order (the words themselves are unchanged).

Input: one line with words separated by single spaces.

Output: the words in reverse order.

Constraints:

  • 1 to 200 words of lowercase letters

Sample Tests

Input 1
the quick brown fox
Output 1
fox brown quick the
Input 2
solo
Output 2
solo

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.