// Arup Guha
// 3/12/2014
// Solution to 2014 FHSPS Playoff Problem: The Hunger Games(hunger)

import java.util.*;

public class hunger {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=0; loop<numCases; loop++) {

			// Read in pts.
			pt[] tri = new pt[3];
			for (int i=0; i<3; i++) {
				int x = stdin.nextInt();
				int y = stdin.nextInt();
				tri[i] = new pt(x,y);
			}

			// Get all sides of triangle and area.
			double a = tri[0].dist(tri[1]);
			double b = tri[0].dist(tri[2]);
			double c = tri[1].dist(tri[2]);
			double area = getArea(a,b,c);

			// x is segment of sides a and b that is perpendicular to the
			// radii of the inscribed circle of the triangle.
			double x = (a+b-c)/2;
			double r = 2*area/(a+b+c);

			// We are traveling from the intersection of a and b down side a.
			double angle = tri[0].getHeading(tri[1]);
			pt next = tri[0].move(x, angle);

			// We must move perpendicular to the old heading. Angle2 tells us whether
			// we rotate right or left.
			double angle2 = tri[0].getHeading(tri[2]);
			if (angle2 > angle && angle2-angle < Math.PI) angle += Math.PI/2;
			else if (angle2 < angle && angle-angle2 > Math.PI) angle += Math.PI/2;
			else angle -= Math.PI/2;

			// Here is where we want to go!
			pt ans = next.move(r, angle);
			System.out.printf("%.2f %.2f\n", ans.x, ans.y);

		}
	}

	// Use Heron's Formula. A better way would be to use the magnitude of the cross product
	// of two defining vectors of the triangle and divide by 2.
	public static double getArea(double a, double b, double c) {
		double s = (a+b+c)/2;
		return Math.sqrt(s*(s-a)*(s-b)*(s-c));
	}
}

class pt {

	public double x;
	public double y;

	public pt(double myx, double myy) {
		x = myx;
		y = myy;
	}

	public double dist(pt other) {
		return Math.sqrt(Math.pow(x-other.x,2) + Math.pow(y-other.y,2));
	}

	public double getHeading(pt other) {
		return Math.atan2(other.y-y, other.x-x);
	}

	// Move from this point distance in the direction angle and return a new object as the end point.
	public pt move(double distance, double angle) {
		double newx = x + distance*Math.cos(angle);
		double newy = y + distance*Math.sin(angle);
		return new pt(newx, newy);
	}
}