X = gets.chomp a, b = X.split(?.) b ||= "" m = b.size n = a.to_i * 10**m + b.to_i d = 10**m g = n.gcd(d) n /= g d /= g puts "#{n}/#{d}"