#include<bits/stdc++.h>usingnamespacestd;constintMAX_E=1e7;inta,b;vector<int>ans;vector<int>current;inlineboolbetter(){returnans.empty()||current.back()<ans.back();}booldfs(intd,longa,longb,inte){if(d==0){if(a==0&&better())ans=current;returna==0;}long_gcd=gcd(a,b);a/=_gcd;b/=_gcd;boolsolved=false;// the min value of e:// a/b - 1/e >= 0// e >= b/ainte1=max(e+1,int((b+a-1)/a));// b/a <= e <= MAX_E// b/a <= MAX_Eif(b>a*MAX_E){returnfalse;}for(;;e1++){// the max value of e:// d * (1/e) >= a/b// d/e >= a/bif(d*b<a*e1){returnsolved;}current.push_back(e1);// a/b - 1/esolved|=dfs(d-1,a*e1-b,b*e1,e1);current.pop_back();}returnsolved;}intsolve(){ans.clear();current.clear();for(intmaxd=1;maxd<=100;maxd++)if(dfs(maxd,a,b,1))returnmaxd;return-1;}intmain(){intkase=0;while(cin>>a>>b){intmaxd=solve();cout<<"Case "<<++kase<<": ";if(maxd>0){cout<<a<<"/"<<b<<"=";for(inti=0;i<maxd-1;i++)cout<<"1/"<<ans[i]<<"+";cout<<"1/"<<ans[maxd-1]<<"\n";}elsecout<<"No solution.\n";}return0;}