#include<bits/stdc++.h>
using namespace std;

long double dis(long double x, long double y, long double z, long double a, long double b, long double c){
    long double res1 = (x - a) * (x - a);
    long double res2 = (y - b) * (y - b);
    long double res3 = (z - c) * (z - c);
    long double res = sqrt(res1 + res2 + res3);  
    return res;  
}
struct st{
    long double fi, se, thi;
} f[25]; 
int sx[25] = {0};  
int main() {
    long double n, a, b, c, x, y, z,ak,bk,ck,res;
    int v = 1,t;
    while(cin >> n) { 
        if(n == 0) return 0;  
        cin >> a >> b >> c;
        for(int i = 0; i < n; ++i) {
            cin >> x >> y >> z;
            f[i].fi = x;
            f[i].se = y;
            f[i].thi = z;
        }
        memset(sx,0,sizeof(sx)); 
        t = 5000000/n;     
        while(t--){
             ak = (long double)rand() / RAND_MAX * a;
             bk = (long double)rand() / RAND_MAX * b;
             ck = (long double)rand() / RAND_MAX * c;
//            cout << ak <<" "<<bk<<" "<<ck<<" "; 
            long double minn = 1000000;
            int j = 0;
            for(int i = 0; i < n; ++i) {
//            cout << f[i].fi <<" "<<f[i].se<<" "<<f[i].thi <<endl;  
              res = dis(f[i].fi, f[i].se, f[i].thi, ak, bk, ck);
                if(res < minn) {
                    minn = res;
                    j = i;
                }
            }
//            cout << j << endl;  
            sx[j]++;  
        }
        cout <<"Case "<<v<<": ";
        ++v; 
        for(int i = 0; i < n; ++i) {  
            cout<<setprecision(3)<< sx[i] / (5000000/n)<< " ";  
       } 
    	cout << endl;
    }
}
//2 3 3 3
//1 1 1
//2 2 2
