a = int(input()) b = int(input()) c = int(input()) a1 = a b1 = b c1 = c c2 = c
while a != b: if a > b: a = a - b else: b = b - a
z = int(a1*b1/a) z1 = z while z != c2: if z > c2: z = z - c2 else: c2 = c2 - z
a = a b= c2 while a != b: if a > b: a = a - b else: b = b - a
#Вывод НОК и НОД o = int(z1*c1/c2) print(a) print(o)