#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define MP make_pair
using namespace std;
typedef long double ld;
ld px[201],py[201],pz[201];
ld vx[201],vy[201],vz[201];
ld r[201],vr[201];
ld lim[201];
ld d[201][201];

ld dist(int i,int j, ld t){
    ld tmp = 0;
    tmp += (px[i]+vx[i]*t-(px[j]+vx[j]*t))*(px[i]+vx[i]*t-(px[j]+vx[j]*t));
    tmp += (py[i]+vy[i]*t-(py[j]+vy[j]*t))*(py[i]+vy[i]*t-(py[j]+vy[j]*t)); 
    tmp += (pz[i]+vz[i]*t-(pz[j]+vz[j]*t))*(pz[i]+vz[i]*t-(pz[j]+vz[j]*t));
    tmp = sqrt(tmp);
    tmp -= r[i]-vr[i]*t;
    tmp -= r[j]-vr[j]*t;
    // if(i==1&&j==0)cerr << i << " " << j << " " << t << " " << tmp << endl;
    return tmp;
}


ld calc(int i,int j){
    ld T = min(lim[i],lim[j]);
    ld x = 0,y = T;
    // cerr << dist(i,j,x) << " " << dist(i,j,y) << endl;
    rep(s,60){
        ld X = (x*2.0+y)/3.0;
        ld Y = (x+y*2.0)/3.0;
        if(dist(i,j,X)>dist(i,j,Y)){
            x = X;
        }else{
            y = Y;
        }
    }
    if(dist(i,j,x)<=0){
        // cerr << x << endl;
        ld ok = x;
        ld ng = 0;
        rep(s,60){
            ld mid = (ok+ng)/2.0;
            if(dist(i,j,mid)<=0){
                ok = mid;
            }else{
                ng = mid;
            }
        }
        return ok;
    }
    return 1000000000;
}

int main(){
    int n;
    while(cin >> n &&n!=0){
        rep(i,n){
            cin >> px[i] >> py[i] >> pz[i] >> vx[i] >> vy[i] >> vz[i] >> r[i] >> vr[i];
            lim[i] = r[i]/vr[i];
        }
        rep(i,n){
            rep(j,n)d[i][j] = (1000000000.0);
        }
        priority_queue<pair<ld,pair<int,int> >,vector<pair<ld,pair<int,int> >>,greater<pair<ld,pair<int,int> >> > pq;
        rep(i,n){
            rep(j,i){
                d[i][j] = calc(i,j);
                if(d[i][j]<1000000.0){
                    pq.push(MP(d[i][j],MP(i,j)));
                    // cerr << i << " " << j << " " << d[i][j] << endl;
                }
            }
        }
        bool flag[201]={};
        ld res[201]={};
        while(!pq.empty()){
            auto x = pq.top();
            pq.pop();
            if(flag[x.second.first]||flag[x.second.second])continue;
            flag[x.second.first] = 1;
            flag[x.second.second] = 1;
            res[x.second.first] = x.first;
            res[x.second.second] = x.first;
        }
        cout.precision(16);
        rep(i,n){
            if(flag[i]){
                cout << fixed  << res[i] << "\n";
            }else{
                cout << fixed << lim[i] << "\n";
            }
        }
    }
    return 0;
}
