#include #include #include #include #include #include #define FOR(i, n, m) for(int i = n; i <= m; i++) using namespace std; typedef long long ll; const int maxn = 1000010; ll x[10], y[10], z[10]; bool check(){ ll dis[10]; int top = 0; FOR(i, 0, 3) FOR(j, i+1, 3) dis[top++] = (x[i]-x[j])*(x[i] - x[j]) + (y[i]-y[j])*(y[i] - y[j])+ (z[i]-z[j])*(z[i] - z[j]); sort(dis, dis + top); int cnt = 0; FOR(i, 0, 5) if(dis[i] == dis[0]) cnt++; return cnt == 4 && dis[4] == dis[5] && dis[4] == 2 * dis[0]; } int main() { int t, cas = 1; scanf("%d", &t); while(t--) { FOR(i, 0, 3) scanf("%lld%lld%lld", &x[i], &y[i], &z[i]); if(check()) printf("Case #%d: Yes\n", cas++); else printf("Case #%d: No\n", cas++); } // system("pause"); return 0; }