DAYOUT2A - Reverse Words

no tags 

In this problem, you will need to reverse the words within a sentence. A word is made of lower case letters and separated by one spaces. There will be no leading or trailing spaces. For example, if the sentence is “sun rises in the east” you need to output “east the in rises sun”.

এই প্রবলেমে তোমার কাজ হলো, একটা বাক্যের শব্দগুলোকে উল্টিয়ে দেওয়া। শব্দ গুলো শুধু মাত্র ছোট হাতের বর্ণ দিয়ে গঠিত হবে এবং তারা একটি স্পেসের মাধ্যমে পৃথক থাকবে। বাক্যের শুরুতে বা শেষে কোন স্পেস থাকবে না। উদাহরনস্বরূপ, বাক্যটি যদি হয় “sun rises in the east” তাহলে তোমার আউটপুট হবে “east the in rises sun”।

Input

First line contains an integer T (T≤20), the number of cases. Then each line will contain a sentence. The length of the sentence will be less than 150.

ইনপুট ফাইলের প্রথম লাইনে থাকবে টেস্ট কেসের সংখ্যা T (T≤20). এরপরে প্রতি লাইনে একটি করে বাক্য থাকবে। বাক্যগুলোর দৈর্ঘ্য ১৫০ এর কম হবে।

Output

For each case print one line where the words are reversed in the sentence. Check sample input and output section for more details.

প্রতি কেসের জন্য বাক্যটির শব্দগুলোকে উল্টিয়ে একটি লাইন প্রিন্ট করতে হবে। নমুনা আউটপুটে আরো বিস্তারিত দেখতে পারো।

Example

Input:
2
sun rises in the east
hello world

Output:
east the in rises sun
world hello

hide comments
nadstratosfer: 2018-06-19 08:44:00

Sample input is wrong, statement is correct: the first line of input is an integer, the number of lines to process.

Sandeep : 2013-03-05 18:09:10


8836689
Showing error anyone??

(Tjandra Satria Gunawan)(曾毅昆): 2013-01-27 21:36:08

Solved using Brainf**k ;-)


Added by:Shafaet
Date:2013-01-17
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem