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