Decimal to Fraction

No attempts yetTime limit2sMemory limit256 MB

Problem

In Dec World every rational number is written as a decimal, and in Frac World every rational number is written as a fraction. The two countries fought over this for a long time, then made peace and agreed to respect each other's notation.

The trouble is that Dec World uses so many decimals that rewriting them as Frac World fractions one by one is hard. After a long discussion the two countries came to you, the great scientist, for help.

Dec World marks a repeating decimal by wrapping the repeating part in parentheses. For example, 0.444... is written as 0.(4). Frac World writes a fraction so that the numerator and the denominator are coprime.

Input

The first line contains one decimal used in Dec World. Its length is at most 10 and its value is not negative.

The number starts with an integer part of one or more digits, and a decimal point, a non-repeating fractional part and a repeating part wrapped in parentheses may follow, in that order. The decimal point and the fractional part may be absent, and the repeating part may be absent. If the decimal point is present, at least one of the non-repeating part and the repeating part is present.

Output

Print on the first line the irreducible fraction equal to the given number, in the form numerator/denominator.

The denominator is always positive, and it is 1 when the value is an integer. For example, print 10/1 when the value is 10.