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

typedef ostringstream OSS;
typedef istringstream ISS;

typedef long long LL;
typedef pair<int, int> PII;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<double> VD;
typedef vector<VD> VVD;
typedef vector<string> VS;
typedef vector<VS> VVS;
typedef vector<bool> VB;
typedef vector<VB> VVB;
typedef vector<PII> VPII;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x) (x).begin(),(x).end()
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define rep(i, N) for (int i = 0; i < (N); i++)
#define rep2(i, j, N, M) rep(i, N) rep(j, M)
#define rep3(i, j, k, N, M, L) rep(i, N) rep(j, M) rep(k, L)
#define REP(i, init, N) for (int i = (init); i < (N); i++)

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a) { OSS oss; oss << a; return oss.str(); };

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int N; // 200

struct Star {
    double ps[3];
    double vs[3];
    double r, vr;       // 1, 100
};

double calc2(double a, double b, double c) {
    double q = b * b - 4. * a * c;
    if (q < 0) return -1;
    return (-1. * b - sqrt(q)) / (2. * a);
}

double distance(Star s1, Star s2) {
    double ps[3], vs[3];
    double pp = 0, vv = 0, v_p = 0;
    for (int i = 0; i < 3; i++) {
        ps[i] = s1.ps[i] - s2.ps[i];
        vs[i] = s1.vs[i] - s2.vs[i];
        pp += ps[i] * ps[i];
        vv += vs[i] * vs[i];
        v_p += ps[i] * vs[i];
    }

    double r = s1.r + s2.r;
    double vr = s1.vr + s2.vr;

    double a = vv - vr * vr;
    double b = 2 * (v_p + r * vr);
    double c = pp - r * r;

    return calc2(a, b, c);
}


vector<Star> S;

struct Sche {
    double time;
    VI is;
    bool operator < (const Sche &s) const { return time < s.time; }
};

VD solve() {
    vector<Sche> sches;

    rep(i, N) {
        Sche s;
        s.time = S[i].r / S[i].vr;
        s.is.PB(i);
        sches.PB(s);
    }

    rep(i, N) REP(j, i + 1, N) {
        Sche s;
        s.time = distance(S[i], S[j]);
        if (s.time < 0) continue;
        s.is.PB(i);
        s.is.PB(j);
        sches.PB(s);
    }

    sort(ALL(sches));

    VD remove_times(N);

    for (auto &sche : sches) {
        bool flg = true;
        for (auto i : sche.is) {
            if (remove_times[i]) {
                flg = false;
                break;
            }
        }

        if (!flg) continue;

        for (auto i : sche.is) {
            remove_times[i] = sche.time;
        }
    }

    return remove_times;
}

int main(void) {
    int ti = 0;
    while (cin >> N, N) {
        S.clear();
        S.resize(N);

        for (auto &s : S) {
            rep(i, 3) cin >> s.ps[i];
            rep(i, 3) cin >> s.vs[i];
            cin >> s.r >> s.vr;
        }

        VD ans = solve();
        for (auto a : ans) {
            printf("%.9f\n", a);
        }

//        if (++ti == 3) break;
    }
    

	return 0;
}

Measured memory_bytes: 2848