There is a castle with

**n** wall segments. The castle is going to be under attack. The enemies can attack from ground or air.

You need to fortify the castle's defenses. You can hire wizards, archers or soldiers for this.
Each segment has two parameters air durability and land durability.

Air durability is sum of archers and wizards assigned to the segment and land durability is sum of soldiers and wizards assigned to the segment. Strength of a segment is minimum of air durability and land durability of the segment.

You are given number of currently assigned wizards, archers and soldiers in each segment. You cannot change current distribution but you have to add up to

**hW** wizards,

**hA** archers and

**hS** soldiers such that strength of castle is maximum possible.

*Strength of castle* is defined to be

*minimum of strength* of all segments.

Input Format:
The first line of the input contains a single integer

**T** denoting the number of test cases.

- The first line of each test case contains four integers
**n**, **hA**, **hW**, **hS**.
- Next 3 lines each contain
**n** integers- archers, wizards and soldiers assigned to **i**^{th} segment **A**_{i}, M_{i}, S_{i} respectively.

Output Format:
Print one integer- Maximum achievable strength of castle.

Constraints:
1 ≤

**T** ≤ 10

1 ≤

**n** ≤ 10

^{5}
1 ≤

**A**_{i}, M_{i}, S

_{i} ≤ 10

^{18}
1 ≤

**hA, hW, hS** ≤ 10

^{18}
Sample Input:
1

4 3 4 3

0 1 3 4

3 3 2 1

1 1 1 1

Sample Output:
5