s = gets.split a = s[0].to_i b = s[1].to_i c = a+b d = a*b puts c.gcd(d)