Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 65536/65536 K (Java/Others)

Young F found a secret record which inherited from ancient times in ancestral home by accident, which named "Four Inages Strategy". He couldn't restrain inner exciting, open the record, and read it carefully. " Place four magic stones at four points as array element in space, if four magic stones form a square, then strategy activates, destroying enemy around". Young F traveled to all corners of the country, and have collected four magic stones finally. He placed four magic stones at four points, but didn't know whether strategy could active successfully. So, could you help him?

Multiple test cases, the first line contains an integer $T$(no more than $10000$), indicating the number of cases. Each test case contains twelve integers $x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,\left|x \right|,\left|y \right|, \left|z \right| \leq 100000$,representing coordinate of four points. Any pair of points are distinct.

提交代码