#SDNU1530. Real Four-tuples
Real Four-tuples
Description
The previous problem is from 2018 Shandong ACM programing contest。 But lmh find this problem have problem, it's test data is different from he did on the day of this contest. So after his hard work, he find the real data and find a powerful judger used to this problem. Now he succeeded in replaying the difficulty of that time. Can you solve it? Given , please count the number of four-tuples such that . The answer should modulo 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 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