#include #include #include using namespace std; struct POS{ double x, y, z; double Dist(const POS& rh)const{ return sqrt((x - rh.x) * (x - rh.x) + (y - rh.y) * (y - rh.y) + (z - rh.z) * (z - rh.z)); } }; const double EPSIRON = 1.000001; bool Equal(double a, double b) { return max(a / b, b / a) < EPSIRON; } main() { int loop; cin >> loop; while (loop--){ double pqr[3]; cin >> pqr[0] >> pqr[1] >> pqr[2]; int n; cin >> n; POS p[n]; for (int i = 0; i < n; ++i){ cin >> p[i].x >> p[i].y >> p[i].z; //cout << p[i].x << p[i].y << p[i].z; } bool ok = false; for (int i = 0; i < n; ++i){ for (int j = 0; j < n; ++j){ if (i == j){ continue; } for (int k = 0; k < n; ++k){ if (i == k || j == k){ continue; } double dist[3] = {p[i].Dist(p[j]), p[j].Dist(p[k]), p[k].Dist(p[i])}; if (Equal(pqr[0] / dist[0], pqr[0] / dist[0]) && Equal(pqr[1] / dist[1], pqr[2] / dist[2])){ cout << k + 1 << " " << i + 1 << " " << j + 1 << endl; i = j = k = n; ok = true; break; } } } } if (!ok){ cout << "error" << endl; } } }