#include <iostream>
#include <vector>
#include <cmath>

using namespace std;
typedef double D;
struct P {
	D x, y, z;
	P(){}
	P(D xx, D yy, D zz):x(xx), y(yy), z(zz){}
};

D dis(P a, P b) {
	return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)+(a.z-b.z)*(a.z-b.z));
}

const double EPS = 0.05;

int main()
{
	int N; cin>>N;
	while (N--) {
		D QR, RP, PQ;
		cin>>QR>>RP>>PQ;
		int M; cin>>M;
		vector<P> points;
		
		for (int i=0; i<M; i++) {
			double x, y, z;
			cin>>x>>y>>z;
			points.push_back(P(x, y, z));
		}
		
		for (int p=0; p<M; p++) {
			for (int q=0; q<M; q++) {
				for (int r=0; r<M; r++) {
					if (p!=q && p!=r) {
						D a = dis(points[p], points[q])/PQ;
						D b = dis(points[q], points[r])/QR;
						D c = dis(points[r], points[p])/RP;
						if (fabs(a-b)<EPS && fabs(b-c)<EPS && fabs(c-a)<EPS) {
							cout << (p+1) << " " << (q+1) << " " << (r+1) << endl;
						}
					}
				}
			}
		}
	}
}