require 'matrix'

def len3d(x, y)
  l2=0.0
  0.upto(3-1){|i|
    l2 += (x[i] - y[i])**2
  }
  return Math.sqrt(l2)
end

def heron(a,b,c)
  s = (a + b + c) / 2.0
  return  Math.sqrt(s*(s-a).abs*(s-b).abs*(s-c).abs)
end

Eps=1e-9
def solve(a,b,c,d,e)   # returns true if beam hits barrier.
  # a, b, c: ????????¢???????§???¢??????????????????????????????
  # d:???????????????????????????
  # e:???????????????????????????
  # a + s*u + t*v = d + x*w ????§£??????(0<x<1) ???P(d+xw)???????§???¢ABC????????¨???????????°??????????????????????????????
  # ??????????????????true?????§???????????°false????????????
  u = c - a
  v = b - a
  w = e - d
  m = Matrix.columns([u, v, -w])

#  abort("Impssible case") if m.determinant.abs <Eps
  return false if m.determinant.abs <Eps
  parms = m.lup.solve(d - a)

  s = parms[0]
  t = parms[1]
  x = parms[2]
# ???P???????§???¢ABC??????????????¢??¨??´???DE??¨?????????
  return false if x < 0 or x > 1.0
  p = d + x*w
# ????§???¢ PAC, PAB, PBC?????¢???????????¨????§???¢ABC?????¢????????????????????°???P???ABC???????????????
  pa = len3d(a, p)
  pb = len3d(b, p)
  pc = len3d(c, p)

  ab = len3d(b, a)
  ac = len3d(c, a)
  bc = len3d(c, b)

  s0=heron(ab,ac,bc)
  s1=heron(pa,pc,ac)
  s2=heron(pa,pb,ab)
  s3=heron(pb,pc,bc)

  return  (s1+s2+s3-s0).abs <Eps
end

def main
  if true then
#  if false then
    fh=STDIN
  else
    #fh=open("in1_0115a.txt")
    #fh=open("in1_0115b.txt")
    fh=open("in1_0115c.txt")
  end
  d1,d2,d3=fh.gets.chomp.split.map{|x| x.to_i}
  e1,e2,e3=fh.gets.chomp.split.map{|x| x.to_i}

  a1,a2,a3=fh.gets.chomp.split.map{|x| x.to_i}
  b1,b2,b3=fh.gets.chomp.split.map{|x| x.to_i}
  c1,c2,c3=fh.gets.chomp.split.map{|x| x.to_i}

  d=Vector[d1,d2,d3]
  e=Vector[e1,e2,e3]
  a=Vector[a1,a2,a3]
  b=Vector[b1,b2,b3]
  c=Vector[c1,c2,c3]

  if solve(a,b,c,d,e) then
    puts "MISS"
  else
    puts "HIT"
  end

end

if $0 == __FILE__ then
  main
end