from fractions import gcd

a,b=list(map(int,input().split()))

gcd=gcd(a,b)

ans=a*b//gcd

print(ans)
a,b=list(map(int,input().split()))

for i in range(1,10**5):

    if a*i % b ==0:

        print((a*i))

        exit()
from fractions import gcd

a, b = list(map(int, input().split()))
gcd = gcd(a, b)
ans = a * b // gcd
print(ans)

a, b = list(map(int, input().split()))
for i in range(1, 10**5):
    if a * i % b == 0:
        print((a * i))
        exit()

-from fractions import gcd - -gcd = gcd(a, b) -ans = a * b // gcd -print(ans) +for i in range(1, 10**5): +    if a * i % b == 0: +        print((a * i)) +        exit()