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

using ld = long double;

constexpr ld eps = 1e-10;

struct event {
    ld t;
    vector<int> star;
    bool operator<(event const& e) const {
        return t < e.t;
    }
};

template<typename... Args>
event make_event(ld t, Args... i) {
    vector<int> v = {i...};
    event e = {t, v};
    return e;
}

int main() {
    int n;
    while(cin >> n, n) {
        vector<ld> x(n), y(n), z(n), vx(n), vy(n), vz(n), r(n), vr(n);
        for(int i=0; i<n; ++i) {
            cin >> x[i] >> y[i] >> z[i] >> vx[i] >> vy[i] >> vz[i] >> r[i] >> vr[i];
        }
        vector<event> events;
        for(int i=0; i<n; ++i) {
            for(int j=i+1; j<n; ++j) {
                ld a = pow(vx[i] - vx[j], 2) + pow(vy[i] - vy[j], 2)
                       + pow(vz[i] - vz[j], 2) - pow(vr[i] + vr[j], 2);
                ld b = 2 * ((x[i] - x[j]) * (vx[i] - vx[j]) + (y[i] - y[j]) * (vy[i] - vy[j])
                            + (z[i] - z[j]) * (vz[i] - vz[j]) + (r[i] + r[j]) * (vr[i] + vr[j]));
                ld c = pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2)
                       + pow(z[i] - z[j], 2) - pow(r[i] + r[j], 2);
                ld D = b * b - 4 * a * c;
                if(abs(a) < eps && abs(b) > eps) {
                    ld t = - c / b;
                    if(t > 0) {
                        events.push_back(make_event(t, i, j));
                    }
                } else if(D >= 0) {
                    ld t1 = (-b - sqrt(D)) / (2 * a);
                    ld t2 = (-b + sqrt(D)) / (2 * a);
                    if(t1 > 0) {
                        events.push_back(make_event(t1, i, j));
                    } else if(t2 > 0) {
                        events.push_back(make_event(t2, i, j));
                    }
                }
            }
            events.push_back(make_event(r[i] / vr[i], i));
        }
        sort(events.begin(), events.end());
        vector<bool> vanish(n);
        vector<ld> res(n);
        for(auto& e : events) {
            bool ok = true;
            for(auto& s : e.star) {
                ok &= !vanish[s];
            }
            if(ok) {
                for(auto& s : e.star) {
                    res[s] = e.t;
                    vanish[s] = true;
                }
            }
        }
        for(auto x : res) {
            cout << fixed << setprecision(10) << x << endl;
        }
    }
}
