Const Zero=1E-9;
Var
a, b, c, d, r,
cx, cy, cz,
sx, sy, sz,
nx, ny, nz,
vx, vy, vz: Double;
Procedure Taxis(t:Double);
Var
mx, my, mz: Double;
Begin
If t < 0 Then Exit;
mx := sx + vx * t;
my := sy + vy * t;
mz := sz + vz * t - 5 * sqr(t);
If Sqr(mx - cx) + Sqr(my - cy) + Sqr(mz - cz) < Sqr(r) Then
Begin
WriteLn('HIT');
Halt;
End;
End;
Begin
Read(cx, cy, cz, nx, ny, nz, r, sx, sy, sz, vx, vy, vz);
a := -5 * nz;
b := vx * nx + vy * ny + vz * nz;
c := (sx - cx) * nx + (sy - cy) * ny + (sz - cz) * nz;
If Abs(a) < Zero
Then If Abs(b) < Zero
then Begin
If Abs(c) < Zero Then
Begin
writeln('HIT');
Halt;
End;
End
Else Taxis(-c / b)
Else Begin
d := Sqr(b) - 4 * a * c;
If (d >= 0) or (Abs(d) < 1E-16) Then
Begin
d := Sqrt(d);
Taxis((-b - d) / 2 / a);
Taxis((-b + d) / 2 / a);
End;
End;
WriteLn('MISSED');
End.