require 'matrix'

def crossover? p, q, r, s
  u = (q - p).conj
  d1, c1 = (u * (r - p)).rect
  d2, c2 = (u * (s - p)).rect
  if c1.zero? and c2.zero?
    d = (u * (q - p)).real
    0 <= d1 && d1 <= d || 0 <= d2 && d2 <= d
  else
    c1 * c2 <= 0
  end
end

def intersect? p, q, r, s
  crossover?(p, q, r, s) && crossover?(r, s, p, q)
end

vs = 5.times.map { Vector.elements gets.split.map(&:to_i), false }
begin
  x, y, z = Matrix.columns([vs[3] - vs[2], vs[4] - vs[2], vs[0] - vs[1]]).lup.solve(vs[0] - vs[2]).to_a
  puts 0 <= z && z <= 1 && (0 <= x && 0 <= y && x + y <= 1) ? 'MISS' : 'HIT'
rescue
  v, w, o = vs[1] - vs[0], *[[vs[3] - vs[2], vs[2]], [vs[4] - vs[2], vs[2]], [vs[4] - vs[3], vs[3]]].max_by {|u, _| u.dot u }
  j = 3.times.max_by {|i| [v, w].count {|u| u[i].zero? } }
  v, w, o, s = [v, w, o, vs[0]].map {|u| a = []; 3.times {|i| a << u[i] unless i == j }; Complex(*a) }
  puts intersect?(s, v, o, w) ? 'MISS' : 'HIT'
end