In this problem, you are to print the decimal expansion resulting from dividing two integers. As is commonly known, the decimal expansion of such a division may have a repeating sequence of digits. You must determine whether a repeating sequence exists and present the expanded form of the fraction. The output should stop when the decimal expansion terminates or when a repeating sequence is encountered. If there is a repeating sequence, you must determine how many digits are in that sequence.
Each input line contains two integers. The first integer is the numerator of a proper fraction, and the second is the denominator. The numerator is always less than the denominator, and the denominator does not exceed . Input ends with a line containing two zeros.
For each input instance, print two parts of the expanded form. In the first part, print the decimal fraction beginning with the decimal point, following these rules: if the expansion terminates, print all of it; if a repeating sequence exists, print up to (but not including) the digit where the sequence would repeat again. For example, 4/11 = .3636363636\ldots should be printed as . (The shortest repeating sequence should be found—for example, in this case, both and are repeating sequences, but the shortest is .)
Since these decimal expansions may be long, each line of the first part must not exceed characters (except possibly the last line), and output starts with the decimal point.
On the line after the decimal expansion, print either This expansion terminates. if the fraction is terminating, or The last digits repeat forever. if it is repeating, where is the number of digits in the repeating sequence.
Helpful hint: The number of digits in the repeating sequence does not exceed the value of the denominator.
Example 1