# 구현하는 방법
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a%b)
first, second = map(int, input().split())
gcd_val = gcd(first, second)
print(gcd_val)
print(first * second // gcd_val)
# math 라이브러리 사용
import math
first, second = map(int, input().split())
gcd_val = math.gcd(first, second)
print(gcd_val)
print(first * second // gcd_val)
입력값
24 18
출력값
6
72