import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

struct Point {
    double x, y, z;
}

int N;
double[] d;
Point[] ps;

void input() {
    d = new double[3];
    scanf("%lf %lf %lf\n", &d[0], &d[1], &d[2]);
    scanf("%d\n", &N);
    bringToFront(d[$ - 2 .. $], d[0 .. $ - 2]);
    ps = new Point[N];
    foreach (i; 0 .. N) {
        double x, y, z;
        scanf("%lf %lf %lf\n", &x, &y, &z);
        ps[i] = Point(x, y, z);
    }
}

double distance(in Point a, in Point b) {
    auto dx = a.x - b.x,
         dy = a.y - b.y,
         dz = a.z - b.z;
    return sqrt(dx * dx + dy * dy + dz * dz);
}

const EPS = 1e-3;
bool EQ(double a, double b) {
    return abs(a - b) <= EPS;
}

void solve() {
    foreach (i; 0 .. N) {
        foreach (j; 0 .. N) {
            foreach (k; 0 .. N) {
                if (i == j || j == k || k == i) continue;
                double[] len;
                len ~= ps[i].distance(ps[j]);
                len ~= ps[j].distance(ps[k]);
                len ~= ps[k].distance(ps[i]);
                static if (false) {
                    writeln(d);
                    write([i, j, k]);
                    writeln(len);
                    writeln(iota(0, 3, 1).map!((x) => len[x] / d[x]));
                    writeln;
                }
                double m = len[0] / d[0];
                foreach (a; 1 .. 3) {
                    if (!EQ(m, len[a] / d[a])) {
                        goto next;
                    }
                }
                writefln("%s %s %s", i + 1, j + 1, k + 1);
                return;
next:;
            }
        }
    }
}

void main() {
    int T; scanf("%d\n", &T);
    foreach (t; 0 .. T) {
        input; solve;
    }
}