def euc(x, y): if y == 0L: return x return euc(y, x%y) A, B = map(int, raw_input().split()) a = long(A) b = long(B) print int(euc(a+b, a*b))