Let b_0, b_1, b_2, , b_n be integers such that b_k > 0 for k > 0. The continued fraction of order with coefficients b_1, b_2, , b_n and initial term b_0 is defined by the following expression:
This expression can be abbreviated as [b_0; b_1, \ldots, b_n].
For example, a continued fraction of order n=3 with [2;3,1,4] is equivalent to:
Write a program that finds the continued fraction expansion for a given rational number. To ensure uniqueness, b_n > 1.
The input consists of an undetermined number of rational numbers. Each rational number is given as a fraction: numerator and denominator.
For each rational number, output its continued fraction representation on a separate line.
Example 1