Egyptian Fractions

Time Limit: 1000 ms Memory Limit: 65536 KiB

Problem Description

                   
                 


Input

The input will consist of a sequence of fractions; one per line. Each line will contain only two integers M and N, where 1 < M < N < 100, representing the fraction M/N. M and N will have no common divisors greater than 1. The end of the input will be indicated by two zeros: 0 0.

Output

For each input fraction M/N you are to output a single line containing numbers D1 ≤ D2 ≤ D3 ≤... such that:

 

Sample Input

3 4 
2 7 
9 20 
17 69 
0 0 

Sample Output

2 4
4 28
3 9 180
5 22 1086 686895

Hint

 

Source