// Arup Guha
// 4/10/20
// Intersect
import java.util.*;

public class intersect {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		for (int loop=1; loop<=nC; loop++) {
		
			v3D[] linepts = new v3D[2];
			for (int i=0; i<2; i++) {
				int x = stdin.nextInt();
				int y = stdin.nextInt();
				int z = stdin.nextInt();
				linepts[i] = new v3D(x,y,z);
			}
			v3D linedir = linepts[0].to(linepts[1]);
			
			v3D[] planepts = new v3D[3];
			for (int i=0; i<3; i++) {
				int x = stdin.nextInt();
				int y = stdin.nextInt();
				int z = stdin.nextInt();
				planepts[i] = new v3D(x,y,z);
			}			
		
			v3D v1 = planepts[0].to(planepts[1]);
			v3D v2 = planepts[0].to(planepts[2]);
			v3D normal = v1.cross(v2);
			int D = normal.dot(planepts[0]);
			int eqnC = normal.dot(linepts[0]);
			int lambdaCoeff = normal.dot(linedir);
			
			System.out.println("Data Set #"+loop+":");
			
			if (lambdaCoeff != 0) {
				double lambda = (D-1.0*eqnC)/lambdaCoeff;
				double x = linepts[0].x + lambda*linedir.x;
				double y = linepts[0].y + lambda*linedir.y;
				double z = linepts[0].z + lambda*linedir.z;
				System.out.printf("The intersection is the point (%.1f, %.1f, %.1f).\n", x, y, z);
			
			}
			else if (D-eqnC == 0)
				System.out.println("The line lies on the plane.");
			else
				System.out.println("There is no intersection.");
				
			System.out.println();
		}
	}
}

class v3D {
	public int x;
	public int y;
	public int z;
	
	public v3D(int myx, int myy, int myz) {
		x = myx;
		y = myy;
		z = myz;
	}
	
	public String toString() {
		return "("+x+" "+y+" "+z+")";
	}
	
	public int dot(v3D other) {
		return x*other.x + y*other.y + z*other.z;
	}
	
	public v3D cross(v3D other) {
		return new v3D(y*other.z-other.y*z, z*other.x-other.z*x, x*other.y-other.x*y);
	}
	
	public v3D to(v3D other) {
		return new v3D(other.x-x,other.y-y,other.z-z);
	}
}
