I have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. The boxes are of two types:

Type 1: each box costs c_{1} Taka and can hold exactly n_{1} marbles

Type 2: each box costs c_{2} Taka and can hold exactly n_{2} marbles

I want each of the used boxes to be filled to its capacity and also to minimize the total cost of buying them. Since I find it difficult for me to figure out how to distribute my marbles among the boxes, I seek your help. I want your program to be efficient also.

Input

The input file may contain multiple test cases. Each test case begins with a line containing the integer n (1 ≤ n ≤ 2,000,000,000). The second line contains c_{1} and n_{1}, and the third line contains c_{2} and n_{2}. Here, c_{1}, c_{2}, n_{1} and n_{2} are all positive integers having values smaller than 2,000,000,000.

A test case containing a zero for n in the first line terminates the input.

Output

For each test case in the input print a line containing the minimum cost solution (two nonnegative integers m_{1} and m_{2}, where m_{i} = number of Type i boxes required) if one exists, print 'failed' otherwise.

If a solution exists, you may assume that it is unique.