#!/usr/bin/ruby
# -*- coding: utf-8 -*-

=begin
Circumscribed Circle of A Triangle.

?????¢????????? (x1, y1) (x2, y2) (x3, y3) ???????????¨??????????§???¢????????\??????????????§?¨? (px, py) ??¨?????? r ???????????????????????????????????°????????????????????????????????????
Input

?????°??????????????????????????????????????????????????????????????????????????° n ???????????????????????????????????????????????????????????\????????¢?????§??????

x1 y1 x2 y2 x3 y3

????????§?????????????????°??¨????????????
Output

????????????????????????????????????px, py, r ??????????????????????????§????????£?????????????????????????????????????°???°?????\????¬¬???????????§?????????????????????????°???°????¬¬??????????????¨?????\??????????????????
Constraints

    -100 ??? x1, y1, x2, y2, x3, y3 ??? 100
    n ??? 20

Sample Input

1
0.0 0.0 2.0 0.0 2.0 2.0

Output for the Sample Input

1.000 1.000 1.414
=end
=begin
(%i2) solve([(px-x1)^2+(py-y1)^2=(px-x2)^2+(py-y2)^2,(px-x1)^2+(py-y1)^2=(px-x3)^2+(py-y3)^2],[px,py]);
                      2     2     2     2            2     2     2      2
(%o2) [[px = - (y2 (y3  - y1  + x3  - x1 ) + y1 (- y3  - x3  + x2 ) + y1  y3
     2        2        2
 - x2  y3 + x1  y3 + y2  (y1 - y3))/(2 x2 y3 - 2 x1 y3 + (2 x1 - 2 x3) y2
                                  2     2     2            2     2
 + (2 x3 - 2 x2) y1), py = (x2 (y3  + x3  - x1 ) + x1 (- y3  - x3 )
               2               2     2        2
 + (x1 - x3) y2  + (x3 - x2) y1  + x1  x3 + x2  (x1 - x3))
/(2 x2 y3 - 2 x1 y3 + (2 x1 - 2 x3) y2 + (2 x3 - 2 x2) y1)]]
(%i3) 
=end

def solve(x1,y1,x2,y2,x3,y3)
  px = - ( y2*(y3**2-y1**2+x3**2- x1**2) + y1*(-y3**2-x3**2+x2**2) + y1**2*y3 \
            - x2**2*y3 + x1**2*y3 + y2**2*(y1 - y3)) \
  / (2*x2*y3-2*x1*y3 + (2*x1 - 2*x3)*y2 + (2*x3-2*x2)*y1)

  py = (x2*(y3**2+ x3**2 - x1**2) + x1*(-y3**2 - x3**2) \
 + (x1 - x3)*y2**2 + (x3 - x2)*y1**2  + x1**2*x3 + x2**2*(x1 - x3)) \
  / (2*x2*y3 - 2*x1*y3 + (2*x1 - 2*x3)*y2 + (2*x3 - 2*x2)*y1)

  r = Math.sqrt((px- x1)**2 + (py- y1)**2)

  return [px,py,r]
end

def rnd3(x)
  return (x*1000).round/1000.0
end
def dist(x, p)
  x1,y1 = x
  px,py = p
  return Math.sqrt((x1-px)**2 + (y1-py)**2)
end

n = gets.to_i
0.upto(n-1){|i|
  x1,y1,x2,y2,x3,y3 = gets.chomp.split.map{|x| x.to_f}
  px,py,r = solve(x1,y1,x2,y2,x3,y3)
  #printf("%.3f %.3f %.3f\n", rnd3(px), rnd3(py), rnd3(r))
  printf("%.3f %.3f %.3f\n", px, py, r)
}