import math from functools import reduce def my_lcm_base(x, y): return (x * y) // math.gcd(x, y) def my_lcm(*numbers): return reduce(my_lcm_base, numbers, 1) T = int(input()) for t in range(T): a,b,c = map(int, input().split(" ")) print(my_lcm(*[a,b,c]))