# SumTheWhat's

Limits 1s, 512 MB

You are given array A and array B consisting of n elements. You can permute the elements in each of these arrays. However, you are not allowed to swap elements between A and B.

You need to produce a new array C of n elements such that for all i, C[i] = A[i] + B[i]. Formally, for a given C, you are interested in two integers X and Y such that the array C contains X occurrences of the value Y, and X is as large as possible.

To generate A, you will be given n and a list of integers A_seed. A_seed contains exactly 6 integers a_0, a_1, a_2, a_3, a_4, a_5. The array A is generated using the following procedure:

A[0] = a0
A[1] = a1
for i = 2 to n - 1:
A[i] = (A[i-1] * a2 + A[i-2] * a3 + a4) mod a5


The array B is generated using B_seed list following the same procedure discussed above.

You need to find two integers: the largest possible X and the largest possible Y for that X.

## Input

First line will contain an integer n (3 <= n <= 10^5). Second and third line will contain 6 integers each denoting A_seed and B_seed respectively. Here, 2 <= seed values <= 10^5.

## Output

For the given input, print two space-separated integers as mentioned.

## Sample

InputOutput
3
1 2 3 4 5 6
1 2 3 4 5 6
3 4