System.in.eachLine{t=it.split('/')*.toLong() a=t[0];b=t[1];f='' while(a>0){f+=' + 1/'+(c=(int)(a+b-1)/a);a=a*c-b;b*=c} println it+' ='+f[2..-1]}