gets a=gets.split.map(&:to_r).inject:/ gets gets.split.map{|e|e=e.to_r;($f=!$f)?(a/=e):(a*=e)} puts"#{a}".sub'/',' '