#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

int main()
{
  int N;
  cin >>N;
  double x1,y1,x2,y2,x3,y3;
  for(int i = 0;i < N;i++){
    cin >>x1>>y1>>x2>>y2>>x3>>y3;
    double a =(x1-x2);
    double b =(y1-y2);
    double c = -(pow(x1,2)+pow(y1,2))+(pow(x2,2)+pow(y2,2));
    double d =(x2-x3);
    double e =(y2-y3);
    double f =-(pow(x2,2)+pow(y2,2))+(pow(x3,2)+pow(y3,2));
    double l =(c*e-f*b)/(a*e-d*b);
    double m =(c*d-a*f)/(b*d-a*e);
    double n = -(pow(x1,2)+pow(y1,2))-(l*x1+m*y1);
    double x = -l/2;
   
    double y =-m/2;
   
    double r =(sqrt(pow(l,2)+pow(m,2)-4*n))/4.0;
    printf("%.3f %.3f %.3f\n",x,y,r);
  }
  
  return 0;
}