import math def main(): a, b = map(int, input().split()) multi = a * b sum = a + b print(math.gcd(multi, sum)) if __name__ == "__main__": main()