from math import gcd def main(): A, B = map(int, input().split()) g = gcd(A, B) ans = g*gcd((A+B)//g,A//g*B//g*g) print(ans) main()