require 'prime' A, B = gets.split.map(&:to_i) n = A + B ans = 1 A.prime_division.each do |e, cnt| cnt.times do break if n % e != 0 n /= e ans *= e end end B.prime_division.each do |e, cnt| cnt.times do break if n % e != 0 n /= e ans *= e end end puts ans