The following languages are only available languages for the problems from the contest

Surprise Language Round #8:

- Kotlin 1.0.5-2

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tags yet

No tag edit access

G. The Fraction

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputPeriodic decimal fraction is usually written as: [entire_part.non-periodic_part (period)]. Any simple fraction can be represented as a periodic decimal fraction and vice versa. For example, the decimal fraction 0.2(45) corresponds to a fraction 27 / 110. Your task is to convert the periodic fraction to a simple periodic fraction.

Input

The first line contains the periodic decimal fraction *x* (0 < *x* < 1) in the format described in the statement. The total number of digits in the period and non-periodic part of the fraction does not exceed 8. Non-periodic part may be absent, the periodic part can't be absent (but it can be equal to any non-negative number).

Output

Print the representation of the fraction *x* as a simple fraction *p* / *q*, where *p* and *q* are mutually prime integers.

Examples

Input

0.2(45)

Output

27/110

Input

0.75(0)

Output

3/4

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/24/2017 11:10:17 (c3).

Desktop version, switch to mobile version.
User lists

Name |
---|