#K67732. Reverse the Words in Each Line

    ID: 32708 Type: Default 1000ms 256MiB

Reverse the Words in Each Line

Reverse the Words in Each Line

You are given multiple lines of text. For each line, reverse the order of the words and output the reversed line. The input terminates when a line containing only a single period ('.') is encountered. Do not process the terminating line.

Note: Words are defined as contiguous sequences of non-space characters. Each line should be processed independently.

Example:

Input:
hello world
this is a test
.

Output: world hello test a is this

</p>

inputFormat

The input consists of multiple lines. Each line contains a sequence of words separated by spaces. The end of the input is indicated by a line that contains only a single period ('.'). This terminating line should not be processed.

outputFormat

For each line (except the terminating line), output a new line where the words are in reverse order, separated by a single space.

## sample
hello world
.
world hello