Spring#235

Spring

1 second
64 megabytes
Very easy

From prehistoric times, the division of numbers was considered one of the most difficult tasks. There was a time when the "secret" of division was known only to a few and was passed down from generation to generation. This was because the existing division algorithms were too cumbersome to use and memorize. When long division appeared, the situation changed dramatically, and division became part of elementary mathematics along with other arithmetic operations. Nevertheless, not everyone mastered division in school. For example, last week, two farmers bought a plot of land. According to the purchase agreement, the share of the land allotted to each farmer was expressed as a decimal fraction. However, neither of them knew how to divide the land according to these values, since the numbers were repeating (periodic) decimal fractions.

Input

The first line contains an integer (T < 20), the number of tests. Each of the following lines contains a decimal fraction in the form 0.[\langle\text{integer}\rangle](\langle\text{integer}\rangle), and the length of each line does not exceed characters.

Output

For each test, output the irreducible fraction in the form \langle\text{integer}\rangle[/\langle\text{integer}\rangle]. If the denominator is , do not print it. Print each answer on a new line.

Examples

Example 1

Loading
Loading