while True:
try:
n=int(input())
for i in range(n):
total=1
a=eval(input())
while a>0:
d=a%10
if d==0:
total=0
else:
total*=d
a//=10
print(total)
except:
break
while True:
try:
n=int(input())
for i in range(n):
total=1
a=eval(input())
while a>0:
d=a%10
if d==0:
total=0
else:
total*=d
a//=10
print(total)
except:
break
輸入0的情況要輸出0,可是你會輸出1