#include #define p(s) cout<<(s)<>A>>B; ll g=__gcd(A,B); p(g*__gcd(A/g+B/g,g)); return 0; }