#include<iostream>
#include<cmath>
using namespace std;
#define REP(i,b,n) for(int i=(int)b;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
double dist(double x,double y,double z){
  return sqrt(x*x+y*y+z*z);
}

void solve(double *x,double *y,double *z,int n,double *t){  
  rep(i,n){
    rep(j,n){
      if ( i == j)continue;
      rep(k,n){
	if ( k==j || k == i)continue;
	double r[3]={
	  dist(x[i]-x[j],y[i]-y[j],z[i]-z[j])/t[0],
	  dist(x[k]-x[j],y[k]-y[j],z[k]-z[j])/t[1],
	  dist(x[k]-x[i],y[k]-y[i],z[k]-z[i])/t[2]
	};
	if ( abs(r[0]-r[1])<0.01&&abs(r[1]-r[2])<0.01 && 
	     abs(r[2]-r[0])<0.01){
	  cout << k+1 << " " << i+1 << " " << j+1<<endl;
	  return;
	}
      }
    }
  }
}


int main(){
  int te;
  cin>>te;
  while(te--){
    int n;
    double t[3];
    rep(i,3)cin>>t[i];
    cin>>n;
    double x[n],y[n],z[n];
    rep(i,n)cin>>x[i]>>y[i]>>z[i];
    solve(x,y,z,n,t);
  }
  return false;
}