#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include // #include // #include // #include // #include #define all(x) begin(x), end(x) using namespace std; // using namespace atcoder; // using mint = modint998244353; // using mint = modint1000000007; using i32 = int; using i64 = long long; void debug(vector a) { for (auto x : a) cout << x << ' '; cout << endl; } void debug(vector> a) { for (auto y : a) debug(y); } template inline bool chmax(T1 &a, T2 b) {return a < b and (a = b, true);} template inline bool chmin(T1 &a, T2 b) {return a > b and (a = b, true);} const i64 supl = LONG_LONG_MAX - 100; void main_() { i64 a, b; cin >> a >> b; i64 g = gcd(a, b); a /= g; b /= g; cout << g * gcd(a + b, g) << endl; } int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); main_(); return 0; }