Heewon got two triangles sitting in three-dimensional space as a birthday present. Each triangle is made of three very thin segments, and a segment does not bend no matter how hard you press it.
Heewon wants to keep only one triangle, so she wants to move the two triangles far apart from each other. Sliding a triangle is allowed, and so is rotating it. Write a program that decides whether the two triangles can be pulled apart this way, or whether they are tangled with each other.
The first line contains the number of test cases T (1≤T≤1000). Each test case takes two lines. The first line has nine integers x1, y1, z1, x2, y2, z2, x3, y3, z3, the vertices of the first triangle, and the second line has nine integers x1′, y1′, z1′, x2′, y2′, z2′, x3′, y3′, z3′, the vertices of the second triangle. Every coordinate is between −1000 and 1000.
The three vertices of each triangle are not on one line. No side of one triangle meets a side of the other triangle, and no single plane contains both triangles.
For each test case, print YES if the two triangles are tangled, and NO if they can be moved far apart from each other. Print each answer on its own line.