for _ in range(int(input())):
    n = list(input())
    n = n[::-1]
    k = ''.join(n)
    print(int(k))

917285e5ffaad495a0596da16fced47d46f37540
<mask token>

for _ in range(int(input())):
    n = list(input())
    n = n[::-1]
    k = ''.join(n)
    print(int(k))
