Tiles of Tetris, NOT!

No attempts yetTime limit1sMemory limit128 MB

Problem

You bought a large batch of identical rectangular tiles. Each tile is $W$ units wide and $H$ units tall, and every tile must be laid down in the same orientation — tiles may not be rotated. By placing several tiles side by side with no gaps you can cover a square region, but only when the square's side length is a multiple of both $W$ and $H$.

Find the minimum number of tiles needed to fill the smallest possible square.

Input

The input contains one or more test cases. Each test case is a single line with two positive integers $W$ and $H$ ($0 < W, H < 10^6$), the width and height of each tile. The input ends with a line containing two $0$s, which is not processed.

Output

For each test case, print on its own line the minimum number of tiles required to fill the smallest possible square.