spoj#MINDIFF. All about Sorting!

All about Sorting!

You will be given three sorted arrays. Let’s denote the three arrays as A, B and C.

Your task is fairly very simple. You just have to find one element from each of the three arrays so that (|Ai-Bj| + |Bj-Ck| + |Ck-Ai|) is the smallest. Here Ai is an element from array A. Bj is an element form array B. Ck is an element form array C.

Input

The first line of the input will be an integer T denote the number of test cases.

For each of the test cases there will three integers Na Nb Nc in the first line. Na will denote the size of array A, Nb will denote the size of array B, Nc will denote the size of array C.

In the second line of each test case there will be Na number of integers denoting the elements of array A.

In the third line of each test case there will be Nb number of integers denoting the elements of array B.

In the fourth line of each test case there will be Nc number of integers denoting the elements of array C.

Output

For each test case print the desired result.

Constraints

1 <= t <= 100
1 <= Na, Nb, Nc <= 1000
Each elements of the arrays will be a non-negative number less than 10^9.

Example

Input:
2
3 2 3
2 4 6
5 7
1 3 5
3 5 4
1 3 5
7 8 9 10 11
2 14 20 36
Output:
2
10