import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); long c = a + b; long ans = 1; long gcd1 = getGCD(c, a); ans *= gcd1; c /= gcd1; long gcd2 = getGCD(c, b); ans *= gcd2; System.out.println(ans); } static long getGCD(long x, long y) { if (x % y == 0) { return y; } else { return getGCD(y, x % y); } } }