Arpit, Kunal and Sunny like to play with arrays a lot. Today, Arpit has an array A consisting of X integers, Kunal has an array B consisting of Y integers and Sunny has an array C consisting of Z integers. All of them decided to play with these arrays together. In a move arpit chooses an index i, kunal chooses an index j and sunny chooses an index k such that i < j < k and Ai < Bj < Ck. Once a triplet ( i, j, k ) has be chosen, it cannot be choose again. They like this game very much and want to play as much as they can. Can you help them by telling them maximum number of moves that they can play ?
First line of input contains a single integer T denoting the number of test cases. First line of each test case contains 3 space separated integer X, Y and Z denoting the size of array A, B and C respectively. Next line of each test contains X space separated integer denoting the array A. Next line of each test contains Y space separated integer denoting the array B. Next line of each test contains Z space separated integer denoting the array C.
For each test case, Print the required answer i.e maximum number of moves that they can play.
Sample Test 1: (1, 2, 3) is the only triplet such that i < j < k and Ai < Bj < Ck.