Go: package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	n := r.nextInt()

	type Vec struct {
		x, y float64
	}
	vec := func(a, b Vec) Vec { return Vec{b.x - a.x, b.y - a.y} }
	unv := func(a Vec) Vec { return Vec{-a.y, a.x} }
	cdot := func(a, b Vec) float64 { return a.x*b.x + a.y*b.y }
	times := func(t float64, a Vec) Vec { return Vec{t * a.x, t * a.y} }
	add := func(a, b Vec) Vec { return Vec{a.x + b.x, a.y + b.y} }
	for i := 0; i < n; i++ {

		r.Scan(true)
		nextFloat64 := func() (ret float64) { fmt.Sscanf(r.nextString(), "%f", &ret); return }
		a1, a2, a3 := Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}, Vec{nextFloat64(), nextFloat64()}
		unv23 := unv(vec(a2, a3))
		v12 := vec(a1, a2)
		v31 := vec(a3, a1)
		s := cdot(v12, v31) / 2 / cdot(v12, unv23)
		c := add(times(.5, add(a2, a3)), times(s, unv23))
		v1c := vec(a1, c)
		fmt.Fprintf(stdout, "%.3f %.3f %.3f\n", c.x, c.y, math.Sqrt(v1c.x*v1c.x+v1c.y*v1c.y))
	}
}

C++: /**************** Geometrical Library ****************/

#include<cmath>
#include<vector>
#include<algorithm>

#define	EPS	1e-8

enum {CCW=1,CW=-1,ON=0};

#define	mp	make_pair
#define	pb	push_back

using namespace std;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy):x(xx),y(yy){}
};

class Line:public vector<Point>{
public:
	Line(const Point &a,const Point &b){
		pb(a),pb(b);
	}
};

class Segment:public Line{
public:
	Segment(const Point &a,const Point &b):Line(a,b){}
};

class Polygon:public vector<Point>{};

class Circle{
public:
	Point c;
	double r;
	Circle(const Point &cc,double rr) : c(cc),r(rr){}
};

Point &operator +=(Point &a,const Point &b){
	a.x+=b.x,a.y+=b.y;
	return a;
}

Point &operator -=(Point &a,const Point &b){
	a.x-=b.x,a.y-=b.y;
	return a;
}

Point &operator *=(Point &a,double c){
	a.x*=c,a.y*=c;
	return a;
}

Point &operator /=(Point &a,double c){
	a.x/=c,a.y/=c;
	return a;
}

Point operator +(const Point &a,const Point &b){
	Point c=a;
	return c+=b;
}

Point operator -(const Point &a,const Point &b){
	Point c=a;
	return c-=b;
}

Point operator *(double c,const Point &a){
	Point b=a;
	return b*=c;
}

Point operator /(const Point &a,double c){
	Point b=a;
	return b/=c;
}

bool operator <(const Point &a,const Point &b){
	return (a.x==b.x)?(a.y<b.y):(a.x<b.x);
}

bool operator >(const Point &a,const Point &b){
	return b<a;
}

double dot(const Point &a,const Point &b){
	return a.x*b.x+a.y*b.y;
}

double cross(const Point &a,const Point &b){
	return a.x*b.y-a.y*b.x;
}

double dis2(const Point &a,const Point &b){
	return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);
}

int ccw(const Point &a,Point b,Point c){
	b-=a,c-=a;
	double rotdir=cross(b,c);
	if(rotdir>EPS)		return CCW;
	if(rotdir<-EPS)		return CW;
	return ON;
}

Polygon ConvexHull(vector<Point> ps){
	int n=ps.size();
	sort(ps.begin(),ps.end());

	vector<Point> ch_u(n);
	int n_u=0;
	for(int i=n-1;i>=0;i--){
		ch_u[n_u++]=ps[i];
		while(n_u>=3 && ccw(ch_u[n_u-3],ch_u[n_u-2],ch_u[n_u-1])!=CCW){
			ch_u[n_u-2]=ch_u[n_u-1];
			n_u--;
		}
	}

	vector<Point> ch_l(n);
	int n_l=0;
	for(int i=0;i<n;i++){
		ch_l[n_l++]=ps[i];
		while(n_l>=3 && ccw(ch_l[n_l-3],ch_l[n_l-2],ch_l[n_l-1])!=CCW){
			ch_l[n_l-2]=ch_l[n_l-1];
			n_l--;
		}
	}

	Polygon ch;
	for(int i=0;i<n_u-1;i++)	ch.pb(ch_u[i]);
	for(int i=0;i<n_l-1;i++)	ch.pb(ch_l[i]);
	return ch;
}

bool parallel(const Line &l,const Line &m){
	return abs(cross(l[1]-l[0],m[1]-m[0]))<EPS;
}

bool orthogonal(const Line &l,const Line &m){
	return abs(dot(l[1]-l[0],m[1]-m[0]))<EPS;
}

inline void calc_abc(const Line &l,double &a,double &b,double &c){	// l : ax+by+c=0
	a=l[0].y-l[1].y;
	b=l[1].x-l[0].x;
	c=l[0].x*l[1].y-l[1].x*l[0].y;
}

bool intersect(const Line &l,const Line &m,Point *p=NULL){
	// this routine also returns true in case "M is on L", "M sessuru L", etc,.
	if(abs(cross(l[1]-l[0],m[1]-m[0]))>EPS
	|| abs(cross(l[1]-l[0],m[0]-l[0]))<EPS){
		if(p){
			double a1,b1,c1,a2,b2,c2;
			calc_abc(l,a1,b1,c1);
			calc_abc(m,a2,b2,c2);
			double det=a1*b2-a2*b1;
			if(abs(det)<EPS)	*p=l[0];	// l == m
			else{
				p->x=(b1*c2-b2*c1)/det;
				p->y=(a2*c1-a1*c2)/det;
			}
		}
		return true;
	}
	return false;
}

bool intersect(const Segment &s,const Segment &t,Point *p=NULL){
	if(max(s[0].x,s[1].x)<min(t[0].x,t[1].x)
	|| max(t[0].x,t[1].x)<min(s[0].x,s[1].x)
	|| max(s[0].y,s[1].y)<min(t[0].y,t[1].y)
	|| max(t[0].y,t[1].y)<min(s[0].y,s[1].y))	return false;

	if(ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1])<=0
	&& ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1])<=0){
		if(p){
			double a1,b1,c1,a2,b2,c2;
			calc_abc(s,a1,b1,c1);
			calc_abc(t,a2,b2,c2);
			double det=a1*b2-a2*b1;
			if(abs(det)<EPS){	// s is parallel to t
				Point q[3]={s[0],s[1],t[0]};
				for(int i=0;i<3;i++){
					if(dot(q[i]-s[0],q[i]-s[1])<EPS && dot(q[i]-t[0],q[i]-t[1])<EPS){
						*p=q[i];
						break;
					}
				}
			}
			else{
				p->x=(b1*c2-b2*c1)/det;
				p->y=(a2*c1-a1*c2)/det;
			}
		}
		return true;
	}
	return false;
}

Point perp_foot(const Point &p,const Line &l){
	double a,b,c;
	calc_abc(l,a,b,c);
	return p-(a*p.x+b*p.y+c)/(a*a+b*b)*Point(a,b);
}

Line perp_bisector(const Point &a,const Point &b){
	return Line(Point((a.x+a.y+b.x-b.y)/2,(b.x+b.y-a.x+a.y)/2),
				Point((b.x+b.y+a.x-a.y)/2,(a.x+a.y-b.x+b.y)/2));
}

double area(const Point &a,const Point &b,const Point &c){
	return abs(cross(b-a,c-a))/2;
}

double area(Polygon &pl){	// !! only convex polygon
	int n=pl.size();
	double a=0;
	for(int i=0;i<n-2;i++)	a+=area(pl[0],pl[i+1],pl[i+2]);
	return a;
}

/**************** Library END ****************/

#include<cstdio>

int main(){
	int n;	scanf("%d",&n);
	while(n--){
		Point a,b,c;	scanf("%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y);
		Line l=perp_bisector(a,b),m=perp_bisector(b,c);
		Point p;
		intersect(l,m,&p);
		double r=sqrt(dis2(p,a));
		printf("%.3f %.3f %.3f\n",p.x,p.y,r);
	}
	return 0;
}