#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

//line is ax + by = c
struct Line{
  double a, b, c;
};

struct Node{
  double x, y;
};

Line perpendicular_bisector(Node a, Node b){
  Line result;
  result.a = a.x - b.x;
  result.b = a.y - b.y;
  result.c = (a.x * a.x - b.x * b.x + a.y * a.y - b.y * b.y) / 2;
  return result;
}

Node intersection(Line l, Line m){
  Node result;
  result.x = (m.b * l.c - l.b * m.c) / (l.a * m.b - m.a * l.b);
  result.y = (m.a * l.c - l.a * m.c) / (m.a * l.b - l.a * m.b);
  return result;
}

double distance(Node a, Node b){
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}

void solve(){
  Node A, B, C;
  cin >> A.x >> A.y;
  cin >> B.x >> B.y;
  cin >> C.x >> C.y;
  Line l = perpendicular_bisector(A, B);
  Line m = perpendicular_bisector(A, C);
  Node center = intersection(l, m);
  double raidus = distance(center, A);
  printf("%.3lf %.3lf %.3lf", center.x, center.y, raidus);
}

int main(){
  int N;
  cin >> N;
  while(N--){
    solve();
  }
}