You need to count the number of quadruples of integers (X1, X2, X3, X4),
such that Li ≤ Xi ≤ Ri for i = 1, 2, 3, 4
and X1 ≠X2, X2 ≠X3,
X3 ≠X4, X4 ≠X1.
The answer could be quite large.
Hence you should output it modulo (109 + 7).
That is, you need to find the remainder of the answer by (109 + 7).
Input Format
The first line of the input contains an integer T denoting the number of test cases.
The description of T test cases follows.
The only line of each test case contains 8 space-separated integers
L1, R1, L2, R2, L3, R3, L4, R4, in order.
Output Format
For each test case, output a single line containing the number of required quadruples modulo (109 + 7).
Constraints
1 ≤ T ≤ 1000
1 ≤ Li ≤ Ri ≤ 109
Sample Input
5
1 4 1 3 1 2 4 4
1 3 1 2 1 3 3 4
1 3 3 4 2 4 1 4
1 1 2 4 2 3 3 4
3 3 1 2 2 3 1 2
Sample Output
8
10
23
6
5
Explanation
Example case 1. All quadruples in this case are
1 2 1 4
1 3 1 4
1 3 2 4
2 1 2 4
2 3 1 4
2 3 2 4
3 1 2 4
3 2 1 4
Example case 2. All quadruples in this case are
1 2 1 3
1 2 1 4
1 2 3 4
2 1 2 3
2 1 2 4
2 1 3 4
3 1 2 4
3 1 3 4
3 2 1 4
3 2 3 4
Example case 3. All quadruples in this case are
1 3 2 3
1 3 2 4
1 3 4 2
1 3 4 3
1 4 2 3
1 4 2 4
1 4 3 2
1 4 3 4
2 3 2 1
2 3 2 3
2 3 2 4
2 3 4 1
2 3 4 3
2 4 2 1
2 4 2 3
2 4 2 4
2 4 3 1
2 4 3 4
3 4 2 1
3 4 2 4
3 4 3 1
3 4 3 2
3 4 3 4
Example case 4. All quadruples in this case are
1 2 3 4
1 3 2 3
1 3 2 4
1 4 2 3
1 4 2 4
1 4 3 4
Example case 5. All quadruples in this case are
3 1 2 1
3 1 3 1
3 1 3 2
3 2 3 1
3 2 3 2