#include int main(void) { long long int A, B, X, Y; scanf("%lld %lld", &A, &B); X = A + B; Y = A * B; while (X%Y != 0 && Y % X != 0) { if (X > Y) { X = X % Y; } else { Y = Y % X; } } if (X > Y) { printf("%lld",Y ); } else { printf("%lld", X); } return 0; }