#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FILLINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a, T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a, T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T& t, const V& v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T& t, const V& v) { for(auto &e : t) fill_v(e, v); }
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const lint MOD = 1000000007;

int n;
double px[210], py[210], pz[210];
double vx[210], vy[210], vz[210];
double r[210], vr[210];
bool used[210];
double ans[210];

void _main() {
    while (cin >> n, n) {
        REP (i, n) {
            cin >> px[i] >> py[i] >> pz[i] >> vx[i] >> vy[i] >> vz[i] >> r[i] >> vr[i];
            ans[i] = r[i] / vr[i];
        }
        ZERO(used);
        using P = tuple<double, int, int>;
        vector<P> ps;
        REP (i, n) FOR (j, i + 1, n) {
            double dpx = px[i] - px[j];
            double dpy = py[i] - py[j];
            double dpz = pz[i] - pz[j];
            double dvx = vx[i] - vx[j];
            double dvy = vy[i] - vy[j];
            double dvz = vz[i] - vz[j];
            double sumr = r[i] + r[j];
            double sumvr = vr[i] + vr[j];
            double A = pow(dvx, 2.0) + pow(dvy, 2.0) + pow(dvz, 2.0) - pow(sumvr, 2.0);
            double B = 2 * (dpx * dvx + dpy * dvy + dpz * dvz + sumr * sumvr);
            double C = pow(dpx, 2.0) + pow(dpy, 2.0) + pow(dpz, 2.0) - pow(sumr, 2.0);
            double D = B * B - 4 * A * C;
            if (D < 0) continue;
            double t1 = (-B - sqrt(D)) / (2 * A);
            double t2 = (-B + sqrt(D)) / (2 * A);
            if (t1 > 0) ps.emplace_back(t1, i, j);
            if (t2 > 0) ps.emplace_back(t2, i, j);
        }
        SORT(ps);
        for (P p : ps) {
            double t = get<0>(p);
            int i = get<1>(p), j = get<2>(p);
            if (used[i] || used[j]) continue;
            if (r[i] - t * vr[i] <= 0) used[i] = true;
            else if (r[j] - t * vr[j] <= 0) used[j] = true;
            else used[i] = used[j] = true, ans[i] = ans[j] = t;
        }
        REP (i, n) cout << ans[i] << endl;
    }
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}


Measured memory_bytes: 4356