Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

The Haunted House

By Jakaria_MU · Limits 1s, 512 MB

Once some friends were walking in a forest on a dirk night. Suddenly they realized that they had lost their way.

After a lot of effort they didn’t find their way. Then they find a spooky house and went inside since they had no other way. It was a great mistake that they were going to spend their night in a haunted house. The ghosts living in the house gave them hints that there are some ghosts in this house. The friends didn’t believe them and they laughed at them.

The ghosts became more dangerous and gave them a message “If you friends do not play with us we will attack on you >-< >-< !”

The only way to survive from the ghosts is to reverse the first half of the length of their message. Since you are a good programmer you know how to help them.

Input

The input begins with an integer T (1 ≤ T ≤ 100) denoting the number of test cases. Each of the following test cases consist a string of any order of at most 50 characters.

Output

The only task is to reverse the first half of the length of the message then print it.

Sample

InputOutput
3
WeWillAttackOnYou
WeWillKillYou
GetOutOfHere.
tAlliWeW
lliWeW
tuOteG


Problem Setter: Barun Bhattacharjee

Discussion
Statistics

95% Solution Ratio

RabelAhmedEarliest, Jul '17

raselrokyFastest, 0.0s

mdvirusLightest, 0 B

touhidurShortest, 66B

Submit

Login to submit