You have been asked to discover some important properties of one strange sequences set. Each sequence of the parameterized set is given by a recurrent formula:

X_{n+1} = F(X_{n-1}, X_{n}),

where n > 1, and the value of F(X,Y) is evaluated by the following algorithm:

- find H = (A
_{1}*X*Y + A_{2}*X + A_{3}*Y + A_{4});
- if H > B
_{1} then H is decreased by C until H ≤ B_{2};
- the resulting value of H is the value of function F.

The sequence is completely defined by nonnegative constants A_{1}, A_{2}, A_{3}, A_{4}, B_{1}, B_{2} and C.

One may easily verify that such sequence possess a property that X_{p+n} = X_{p+q+n} for appropriate large enough positive integers p and q and for all n ≥ 0. You task is to find the minimal p and q for the property above to hold. Pay attention that numbers p and q are well defined and do not depend on way minimization is done.

### Input

The first line contains seven integers: A_{1}, A_{2}, A_{3}, A_{4}, B_{1}, B_{2} and C. The first two members of sequence (X_{1} and X_{2}) are placed at the second line. You may assume that all intermediate values of H and all values of F fit in range [0..100000].

### Output

An output should consist of two integers (p and q) separated by a space.

### Sample

input | output |
---|

0 0 2 3 20 5 7
0 1 | 2 3 |

**Problem Author: **Alexander Klepinin

**Problem Source: **Third USU personal programming contest, Ekaterinburg, Russia, February 16, 2002