#32427: python 一行解!!


gene323 (楊森豪)


p = [print(__import__("functools").reduce((lambda x, y: x * y), list(map(int, input())))) for i in range(int(input()))]