This page is still under construction.

Parts of this page are still being built. What you see may change.

Reverse Text

Interview

Time limit1sMemory limit128 MB

Summary
Read each test case line and print its characters in reverse order.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

In most languages, text is written from left to right. However, some languages are read and written from right to left. As a first step toward a program that automatically translates between a left-to-right language and a right-to-left language in both directions, write a program that reverses the direction of a given text.

Input

The first line contains an integer TT, the number of test cases. Each of the following TT lines contains a single line of text consisting of at most 70 characters. The newline character at the end of each line is not counted as part of the line.

Output

For each test case, print a line containing the characters of the input line in reverse order.

Examples4

  1. Example 1

    Input
    3
    Frankly, I don't think we'll make much
    money out of this scheme.
    madam I'm adam
    
    Expected output
    hcum ekam ll'ew kniht t'nod I ,ylknarF
    .emehcs siht fo tuo yenom
    mada m'I madam
    
  2. Example 2

    Input
    1
    hello
    
    Expected output
    olleh
    
  3. Example 3

    Input
    1
    A
    
    Expected output
    A
    
  4. Example 4

    Input
    1
    was it a car or a cat I saw
    
    Expected output
    was I tac a ro rac a ti saw