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

int main(void){
  int n;
  double x1, y1, x2, y2, x3, y3;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    double xp1 = x1 - x3, yp1 = y1 - y3, xp2 = x2 - x3, yp2 = y2 - y3;
    double A, B, C;
    double cx, cy, r;
    A = (xp1 / yp1 - xp2 / yp2);
    B = (xp1 * xp1 / yp1 + yp1) / 2;
    C = (xp2 * xp2 / yp2 + yp2) / 2;
    cx = (B - C) / A;
    cy = (xp1 * xp1 / yp1 + yp1) / 2 - cx * xp1 / yp1;
    cx += x3; cy += y3;
    r = hypot(cx - x1, cy - y1);
    printf("%.3lf %.3lf %.3lf\n", cx + 0.0005, cy + 0.0005, r + 0.0005);
  }
  return 0;
}