import math A,B=map(int,input().split()) G=math.gcd(A,B) p=A//G q=B//G print(G*math.gcd(p+q,G*p*q))