11740 - Sentence reversal v2   

Description

Difficulty: ★★★☆☆

Given several sentences, please modify the sentences so that the order of the words is reversed.

Input

The first line is the number of lines L.

The following is L lines, each line contains a sentence with several words.

Each word will be separated by one or several whitespace.

Also, whitespaces may appear in the front or in the back of the sentence.

It is guaranteed that:

  • 1  ≤ L  ≤ 10.
  • Each line contains at most 100 characters.
  • Contains only lowercase letter in each word.

Output

For each sentence, please output the two line.

First one is original sentence and second is modified sentence with the reverse sequence of words.

Attention: 

(1) After modification, each word is separated by only one whitespace.

(2) If there is no word in the sentence, you still need to output '\n'.

Sample Input  Download

Sample Output  Download

Tags




Discuss