SDE Path

Reverse Words in a String

Easy

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 blue
Expected output
blue is sky the
Example 2
Input
hello
Expected output
hello