1. #Dimikoj Accept

  2. for T in range(int(input())):
  3. N = str(int(input()))
  4. print(int(N[::-1]))