Reverse Words (Large)

No attempts yetTime limit5sMemory limit512 MB

Problem

A line holds a list of words separated by spaces. Print the words in reverse order.

Each line contains LL letters and WW words. A line consists only of letters and space characters. Exactly one space separates each pair of consecutive words.

Input

The first line contains the number of test cases NN.

Each of the next NN lines contains one test case: a list of words separated by spaces. A line has no space at its start or end.

Limits

  • 1N1001 \le N \le 100
  • 1L10001 \le L \le 1000

Output

For each test case, print one line. Print Case #x: followed by the words in reverse order, separated by single spaces. Here xx is the test case number, starting at 1.