#include<cstdio>
int main(void) {
	long long int A, B, X, Y, Z, ANS1, ANS2, ANS;
    scanf("%lld %lld", &X, &Y);
	A = X;
	B = Y;
	while (A%B != 0 && B % A != 0) {
		if (A > B) { A = A % B; }
		else { B = B % A; }
	}
	if (A > B) { ANS1 = B; }
	else { ANS1 = A; }

	A = X / ANS1;
	B = Y / ANS1;
	Z = A + B;

	while (Z%ANS1 != 0 && ANS1 % Z != 0) {
		if (Z > ANS1) { Z = Z % ANS1; }
		else { ANS1 = ANS1 % Z; }
	}
	if (ANS1 > Z) { ANS2 = Z; }
	else { ANS2 = ANS1; }
	ANS = ANS1 * ANS2;
	printf("%lld", ANS);
	return 0;

}