require 'matrix'

vs = 5.times.map { Vector.elements gets.split.map(&:to_i), false }
v, w = vs[3]- vs[2], vs[4] - vs[2]
j = 3.times.max_by {|i| [v, w].count {|u| u[i].zero? } }
x, y, z = Matrix.rows([v, w, 3.times.map {|i| i == j ? 1 : 0 }]).inv * (vs[1] - vs[2])
if z == 0 && 0 <= x && 0 <= y && x + y <= 1
  puts 'MISS'
else
  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
    puts 'HIT'
  end
end