#include using namespace std; using ll = long long; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)<> A >> B; ll g = gcd(A, B); ll ans = g * gcd(A/g+B/g, g); p(ans); return 0; }