from math import *

print("три числа через пробел")
x, y, z = map(int, input().split())
#НОД
d = gcd(x, y, z)
#НОК
f = lcm(x, y, z) 
print("НОД =", d)
print("НОK =", f)
