// Michael Galletti
// 3/12/2014
// Solution to FHSPS Problem: Hunger Games(hunger)

import java.util.*;
import java.io.*;

//The problem here is to find the center of the circle that inscribes the triangle.
//What's interesting about this point is that each line that bisects the triangle's vertices
//will intersect here! So, we need merely find a pair of these lines and intersect them. 
public class hunger_galletti {
	public static void main(String[] args) throws Exception{
		Scanner reader = new Scanner(new File("hunger.in"));
		
		int times = reader.nextInt();
		for(int t = 0; t < times; t++){
			//Read in x and y coordinates for each vertex
			double[] x = new double[3];
			double[] y = new double[3];
			for(int i = 0; i < 3; i++){
				x[i] = reader.nextDouble();
				y[i] = reader.nextDouble();
			}
			
			//Compute the angle bisector for each vertex
			double[] ang = new double[3];
			for(int i = 0; i < 3; i++){
				//First find the dx and dy for each leg extending from this vertex
				double dx1 = (x[(i+1)%3] - x[i]);
				double dy1 = (y[(i+1)%3] - y[i]);
				double dx2 = (x[(i+2)%3] - x[i]);
				double dy2 = (y[(i+2)%3] - y[i]);
				
				//Find the angle of each segment leaving this vertex
				//tan(theta) = dy/dx
				//theta = atan(dy/dx)
				//We'll use the method Math.atan2(y,x) to compute theta.
				//Because atan2 returns a value in the range (-PI, PI),
				//we'll have to shift the result into the range (0, 2*PI).
				double t1 = (2*Math.PI + Math.atan2(dy1, dx1)) % (2*Math.PI);
				double t2 = (2*Math.PI + Math.atan2(dy2, dx2)) % (2*Math.PI);
				
				//The average of the two angles is our bisector!
				ang[i] = (t1 + t2)/2;
			}
			
			//The tricky part here is dealing with vertical lines. We can guarantee that only one bisector
			//can possibly be vertical, so if this is the case we need simply use the other two vertices!
			//We'll know if a bisector is vertical if it's really close to either 90 or 270 degrees.
			double[] sol = new double[2];
			if(Math.abs((ang[0] % Math.PI) - Math.PI/2) < 1e-9){ 
				//If this is true, bisector 0 is vertical! Use bisectors 1 and 2.
				sol = solve(x[1], y[1], ang[1], x[2], y[2], ang[2]);
			}else if(Math.abs((ang[1] % Math.PI) - Math.PI/2) < 1e-9){ 
				//If this is true, bisector 1 is vertical! Use bisectors 0 and 2. 
				sol = solve(x[0], y[0], ang[0], x[2], y[2], ang[2]);
			}else{
				//Otherwise, bisectors 0 and 1 are not vertical and are safe to use.
				sol = solve(x[0], y[0], ang[0], x[1], y[1], ang[1]);
			}
			
			//Output our answer to 2 decimal places.
			System.out.printf("%.2f %.2f\n",sol[0],sol[1]);
		}
	}
	
	//This method will intersect two lines. Each line is specified as a point and angle (much like a ray!).
	public static double[] solve(double x1, double y1, double a1, double x2, double y2, double a2){
		double m1 = Math.tan(a1); //tan(theta) = y/x, which just so happens to be the slope of the line (rise over run).
		double m2 = Math.tan(a2); //Likewise here, we now have the slopes of both lines and a point on each.
		double b1 = y1 - m1 * x1; //y = mx + b --> b = y - mx
		double b2 = y2 - m2 * x2; //Likewise here, we now have the slopes and y-intercepts of our lines.
		
		
		//We'll return the intersection point in this array, ret[0] = x and ret[1] = y
		double[] ret = new double[2];
		
		//We now have 2 equations and 2 unknowns, the x and y coordinates of our intersection point.
		//(1.)  y = m1 * x + b1                   Given
		//(2.)  y = m2 * x + b2                   Given
		//(3.)  0 = (m1 - m2) * x + b1 - b2       Subtract (2.) from (1.)
		//(4.)  (b2 - b1) / (m1 - m2) = x         Solve for x
		ret[0] = (b2 - b1) / (m1 - m2);
		
		//We can then plug x back into (1.) to solve for y; we're done!
		ret[1] = m1 * ret[0] + b1;
		
		//Return the point of intersection!
		return ret;
	}
}
