#include <iostream>
#include <cmath>
#define EPS 0.01
using namespace std;

class Point{
public:
  double x, y, z;
};


double norm(Point a, Point b){
  return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)+(a.z-b.z)*(a.z-b.z);
}
double abs(Point a, Point b){
  return sqrt(norm(a, b));
}
int main(){
  Point in[30];
  double qr, rp, pq;
  int n;
  while(cin >> n){
    int np;
    for(int count=0;count<n;count++){
      cin >> qr >> rp >> pq;
      cin >> np;
      for(int i=0;i<np;i++){
	cin >> in[i].x >> in[i].y >> in[i].z;
      }
      bool end=false;
      for(int p=0;p<np;p++){
	for(int q=0;q<np;q++){
	  if(p==q) continue;
	  for(int r=0;r<np;r++){
	    if(p==r) continue;
	    if(q==r) continue;
	    double a, b, c;
	    a=abs(in[q], in[r]);
	    b=abs(in[r], in[p]);
	    c=abs(in[p], in[q]);
	    double tmp=a/qr;
	    if(b/rp>=tmp-EPS && b/rp<=tmp+EPS){
	      printf("%d %d %d\n", p+1, q+1, r+1);
	      end=true;
	      break;
	    }else if(c/pq>=tmp-EPS && c/pq<=tmp+EPS){
	      printf("%d %d %d\n", p+1, q+1, r+1);
	      end=true;
	      break;
	    }
	  }
	  if(end) break;
	}
	if(end) break;
      }
    }
  }
  return 0;
}