Repeating Decimals
A routine problem in basic mathematics is to convert fractions to decimals. For example, is just 0.5 while is 0.333..., which is simply written as . The decimal 0.5 is said to be terminating while is repeating. Other examples of fractions which convert to repeating decimals are:
Your task is to determine the fraction in lowest terms that is equal to a given repeating decimal.
Input
The input consists of one or more input lines. Each input line consists of a repeating decimal. The digits that repeat are enclosed in a pair of parentheses. The total number of digits in the decimal is at most 9.
Output
The output consists of one or more lines with each line consisting of the given input followed by the equal sign and followed by the fraction in lowest terms. The fraction is displayed in the form x / y, where x is the numerator and y is the denominator.