#include using namespace std; template T gcd(T a,T b){ if(a%b==0)return b; else return gcd(b,a%b); } int main(){ int a,b;cin>>a>>b; int A = a/gcd(a,b),B = b/gcd(a,b); int ans = -1; while(A){ if(A