#SDNU1529. Four-tuples
Four-tuples
Description
Given please count the number of four-tuples such that and , , ,. The answer should modulo 1e9+7 before output.
Input
The input consists of several test cases. The first line gives the number of test cases, . For each test case, the input contains one line with 8 integers .
Output
For each test case, output one line containing one integer, representing the answer.
Sample Input
1
1 1 2 2 3 3 4 4
Sample Output
1