#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define fix(n) cout<; const ll MOD = 1000000007; // 10^9 + 7 const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; ll gcd(ll a, ll b) { if (a < b) return gcd(b, a); if (b == 0) return a; return gcd(b, a % b); } void solve() { ll A, B; cin >> A >> B; if (A > B) swap(A, B); if (B % A == 0) outl(A * gcd(A, B / A + 1)); else outl(gcd(A, B)); } signed main() { cin.tie(0); ios::sync_with_stdio(false); srand((unsigned)time(NULL)); fix(12); solve(); }