#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <cmath>
#define INF 100000000
using namespace std;
#define pw(a) (a)*(a)

int main(){
  double x1,x2,x3,y1,y2,y3;
  int n;
  cin >> n;
  while(n--){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    double a,b,l,m,n;
    a = -1*(pw(x1) - pw(x2) + pw(y1) - pw(y2));
    b = -1*(pw(x1) - pw(x3) + pw(y1) - pw(y3));
    l = (a*(y1-y3)-b*(y1-y2))/((y1-y3)*(x1-x2)-(x1-x3)*(y1-y2));
    m = ((x1-x3)*a - (x1-x2)*b)/((x1-x3)*(y1-y2)-(y1-y3)*(x1-x2));
    n = -1*(pw(x1) + pw(y1)+ l*x1 + m*y1);
    printf("%.3f %.3f %.3f\n",-l/2.0,-m/2.0,sqrt((pw(l) + pw(m) - 4*n))/2.0);
  }
  return 0;
}