#39675: 自己抄


qiyalin136 (JAK)


解答

 

t = int(input())
for i in range(t):
  n = input()
  ans = 1
  for j in n:
    ans *= int(j)
  print(ans)