// Arup Guha
// 9/2/09
// Solution to 2009 UCF Local Contest Problem: Balance

import java.util.*;
import java.io.*;

// Stores a basic point!
class point {
	
	public double x;
	public double y;
	
	public point (double myx, double myy) {
		x = myx;
		y = myy;
	}
	
	// Returns the Cartesian distance between this and other.
	public double distance(point other) {
		return Math.sqrt(Math.pow(x-other.x,2) + Math.pow(y-other.y,2));
	}
	
	// Returns the distance from this point to the origin.
	public double magnitude() {
		return Math.sqrt(Math.pow(x,2)+Math.pow(y,2));
	}
}

class triangle {
	
	// I am just going to store lots of stuff about this triangle!
	public point A;
	public point B;
	public point C;
	public double dAB;
	public double dAC;
	public double dBC;
	public double area;
	
	public triangle(point one, point two, point three) {
		
		// Set up our original points and distances.
		A = one;
		B = two;
		C = three;
		dAB = A.distance(B);
		dAC = A.distance(C);
		dBC = B.distance(C);
		
		// Calculate the triangle area.
		area = getArea();
		
		// Reorient A,B and C so AB > AC > BC.
		resetABC();
	}
	
	// Returns the area of this triangle using Heron's rule.
	public double getArea() {
		double s = (dAB+dAC+dBC)/2;
		return Math.sqrt(s*(s-dAB)*(s-dAC)*(s-dBC));
	}	
		
	// Exchanges the sides so that AB > AC > BC
	public void resetABC() {
		
		// AC min
		if (dAC < dAB && dAC < dBC) {
			// Swap A and B
			point temp = A;
			A = B;
			B = temp;
			
			// Swap B and C
			if (dBC > dAB) {
				temp = B;
				B = C;
				C = temp;
			}
		}
		
		// AB min
		else if (dAB < dAC && dAB < dBC) {
			// Swap A and C
			point temp = A;
			A = C;
			C = temp;
			
			// Swap B and C
			if (dAC > dBC) {
				temp = B;
				B = C;
				C = temp;
			}
			
		}
		
		// BC min, but AC and AB out of order
		else if (dAC > dAB) {
			point temp = B;
			B = C;
			C = temp;
		}
		
		// Now that we've reassigned the points, update the distances.
		dAB = A.distance(B);
		dAC = A.distance(C);
		dBC = B.distance(C);
		
	}
	
	public point getBalancePoint() {
		
		// Figure out angle between AB and AC.	
		double dotproduct = (B.x-A.x)*(C.x-A.x) + (B.y-A.y)*(C.y-A.y);	
		double angleBAC = Math.acos(dotproduct/dAB/dAC);
		
		double distOnAB = Math.sqrt(area/Math.tan(angleBAC));
		
		// The ratio from point A to point B, we must go, to find the balance point.
		double ratio = distOnAB/dAB;
		
		// Now, we calculate the balance point. Start at point A, and move towards 
		// point B, but only ratio amount of the way. If ratio = 1, this we'd be 
		// exactly at point B. This won't ever happen though.
		return new point(A.x+ratio*(B.x-A.x), A.y+ratio*(B.y-A.y));
		
	}
	
}

public class balance {
	
	public static void main(String[] args) throws Exception {
		
		// Open up the file.
		Scanner fin = new Scanner(new File("balance.in"));
		int numCases = fin.nextInt();
		
		// Read through all the cases.
		for (int i=1; i<=numCases; i++) {
			
			// Form our triangle for this case.
			point A = new point(fin.nextDouble(), fin.nextDouble());
			point B = new point(fin.nextDouble(), fin.nextDouble());
			point C = new point(fin.nextDouble(), fin.nextDouble());
			triangle Tom = new triangle(A,B,C);
			
			// Get the answer and print it out!
			point balancePoint = Tom.getBalancePoint();
			System.out.printf("Triangle #%d Balance Point: (%.2f,%.2f)\n", i, balancePoint.x, balancePoint.y);
		}
		
		fin.close();
	}
}