#PCBBAY0000054. Phân số chính xác của float (Exact Fraction of a Float)

Phân số chính xác của float (Exact Fraction of a Float)

Exact Fraction of a Float

Version: Phuoc Hung OJ Extended

Problem Statement

Given a real number xx parsed as a Python 3 float, find integers pp and q>0q>0 with x=pqx=\dfrac pq exactly for the stored binary value, in lowest terms. Do not use the ideal decimal fraction of the input text. Match Python x.as_integer_ratio().

Input

The only line contains finite real number xx, parsed as Python 3 float.

Output

Print integers pp and qq on one line, separated by a space: numerator first, positive denominator second. The fraction must be reduced.

Subtasks

  • Subtask 1 (100 points): xx is a finite Python float; the denominator must be positive.

Examples

Example 1

Input

0.5

Output

1 2

Explanation. The value 0.5=1/20.5=1/2 is represented exactly; numerator 11 and denominator 22 are already coprime.

Example 2

Input

0.1

Output

3602879701896397 36028797018963968

Explanation. Decimal 0.10.1 has no finite binary representation. The displayed fraction exactly represents the stored float, rather than the ideal value 1/101/10.

Example 3

Input

1.25

Output

5 4

Explanation. Since 1.25=125/100=5/41.25=125/100=5/4 and 55 and 44 are coprime, the output is 5 4.