t = int(input())
for _ in range(t):
    a,b,c = map(int,input().split())
    print(min(a,c) * min(b,c))

