#C8688. Reverse Words in a Sentence

    ID: 52697 Type: Default 1000ms 256MiB

Reverse Words in a Sentence

Reverse Words in a Sentence

Given a sentence with words separated by spaces, reverse the order of the words while keeping the characters in each word unchanged. For example, if the input is "hello world", the output should be "world hello". This applies to every test case provided.

You will be given multiple test cases via standard input. Each test case consists of a single sentence. Note that sentences may include extra spaces, and may even be empty.

inputFormat

The input begins with an integer T denoting the number of test cases. Each of the next T lines contains a sentence.

outputFormat

For each test case, output a single line containing the sentence with the order of the words reversed.

## sample
3
hello world
this is an example
single
world hello

example an is this single

</p>