def dist(p, q)
  Math.sqrt((0..2).reduce(0){ |s, i| s + (p[i] - q[i]) ** 2 })
end
 
gets.to_i.times do
  real = gets.split.map(&:to_f)
  m = gets.to_i
  ps = m.times.map{ gets.split.map(&:to_f) }
  tbl = ps.map{ |p| ps.map{ |q| dist(p, q) } }
  (0...m).to_a.combination(3) do |i, j, k|
    imag = [tbl[j][k], tbl[k][i], tbl[i][j]]
    if imag.sort.zip(real.sort).map{ |i, r| i / r }.combination(2).map{ |x, y| x / y }.all?{ |v| (1 - v).abs < 0.001 }
      (0..2).to_a.permutation(3) do |idx|
        if idx.map{ |i| imag[i] }.zip(real).map{ |i, r| i / r }.combination(2).map{ |x, y| x / y }.all?{ |v| (1 - v).abs < 0.001 }
          p = [i + 1, j + 1, k + 1]
          puts idx.map{ |i| p[i]}.join(' ')
          break
        end
      end
    end
  end
end