require 'set'
include Math

loop do
	n = gets.to_i
	break if n == 0

	events = []
	stars = (0..n-1).map do |i|
		s = gets.split.map(&:to_f)
		events << [s[-2] / s[-1], i]
		s
	end
	
	(0..n-1).to_a.combination(2) do |s1, s2|
		px1, py1, pz1, vx1, vy1, vz1, r1, vr1 = stars[s1]
		px2, py2, pz2, vx2, vy2, vz2, r2, vr2 = stars[s2]
		dvx = vx1 - vx2
		dvy = vy1 - vy2
		dvz = vz1 - vz2
		dpx = px1 - px2
		dpy = py1 - py2
		dpz = pz1 - pz2
		sr = r1 + r2
		svr = vr1 + vr2
		a = dvx ** 2 + dvy ** 2 + dvz ** 2 - svr ** 2
		b = 2 * (dvx * dpx + dvy * dpy + dvz * dpz + sr * svr)
		c = dpx ** 2 + dpy ** 2 + dpz ** 2 - sr ** 2
		d = b ** 2 - 4 * a * c
		next if d <= 0

		t = (-b - sqrt(d)) / (2 * a)
		events << [t, s1, s2] if t > 0
		t = (-b + sqrt(d)) / (2 * a)
		events << [t, s1, s2] if t > 0
	end
	
	events.sort_by!(&:first)

	vanished = Set.new	
	vanish_time = []
	events.each do |t, s1, s2|
		if !s2
			next if vanished.include?(s1)
			vanished << s1
			vanish_time[s1] = t
		else
			next if vanished.include?(s1)
			next if vanished.include?(s2)
			vanished << s1
			vanished << s2
			vanish_time[s1] = t
			vanish_time[s2] = t
		end
	end	
	puts vanish_time.map {|f| sprintf("%.9f", f)}
end