[*$<].map{|n|puts n.strip+" = "+[n.split'/'].map(&z=proc{|n|a,b=n.map(&:to_i);b%a<1?"1/#{b/a}":"1/#{c=b/a+1} + "+[[a*c-b,b*c]].map(&z)*''})*''}