def reverse(S):
    return S[::-1]
    
#Driver Code Starts.
if __name__=='__main__':
    t=int(input())
    for i in range(t):
        str1=input()
        print(reverse(str1))

f49d9e781086c9962ec957cb44eb1d2015262c69
<mask token>

def reverse(S):
    return S[::-1]


<mask token>

def reverse(S):
    return S[::-1]


if __name__ == '__main__':
    t = int(input())
    for i in range(t):
        str1 = input()
        print(reverse(str1))

def reverse(S):
    return S[::-1]
    
#Driver Code Starts.
if __name__=='__main__':
    t=int(input())
    for i in range(t):
        str1=input()
        print(reverse(str1))
