#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-4;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"

ld getdis(vector<ld>&l, vector<ld>&r) {
	ld sum = 0;
	for (int i = 0; i < 3; ++i) {
		sum += powl(r[i] - l[i], 2);
	}
	return sqrt(sum);
}

int main() {
	int N; cin >> N;
	while (N--) {

		vector<ld>lens(3);
		for (int i = 0; i < 3; ++i)cin >> lens[i];
		int M; cin >> M;
		vector<vector<ld>>points(M,vector<ld>(3));
		for (int i = 0; i < M; ++i) {
			for (int j = 0; j < 3; ++j) {
				cin >> points[i][j];
			}
		}
		vector<int>anss;
		for (int p = 0; p < M; ++p) {
			for (int q = 0; q < M; ++q) {
				for (int r = 0; r < M; ++r) {
					if (p == q || q == r || r == p)continue;
					ld a = getdis(points[p], points[q]);
					ld b = getdis(points[q], points[r]);
					ld c = getdis(points[r], points[p]);
					ld rate = a / lens[0];
					a /= rate;
					b /= rate;
					c /= rate;
					if ((abs(a - lens[0]) < eps) && (abs(b - lens[1]) < eps) && (abs(c - lens[2]) < eps)) {
						anss = vector<int>{ r,p,q };
					}
				}
			}
		}
		for (int i = 0; i < 3; ++i) {
			cout << anss[i] + 1;
			if (i == 2)cout << endl;
			else cout << " ";
		}
	}
	return 0;
}