import Control.Applicative


type Vector = [Double]
type Matrix = [[Double]]

main = do
    uaz <- map read.words<$>getLine
    enemy <- map read.words<$>getLine
    base1 <- map read.words<$>getLine
    base2 <- map read.words<$>getLine
    base3 <- map read.words<$>getLine
    let b1 = addV base1 (negV uaz)
        b2 = addV base2 (negV uaz)
        b3 = addV base3 (negV uaz)
        vec = addV enemy (negV uaz)
        res = all (> 0) $ convertBase b1 b2 b3 vec
    print vec
    print $ convertBase b1 b2 b3 vec
    if res then putStrLn "MISS"
           else putStrLn "HIT"

addV :: Vector -> Vector -> Vector
addV = zipWith (+)

negV :: Vector -> Vector
negV = map negate

multV :: Double -> Vector -> Vector
multV a v = map (*a) v

dot :: Vector -> Vector -> Double
dot a b = sum $ zipWith (*) a b

multMV :: Matrix -> Vector -> Vector
multMV m v = map (dot v) m

convertBase :: Vector -> Vector -> Vector -> Vector -> Vector
convertBase b1 b2 b3 v = multMV (inverse.transpose $ [b1,b2,b3]) v

transpose :: Matrix -> Matrix
transpose ([]:_) = []
transpose xs = map head xs : transpose (map tail xs)

inverse :: Matrix -> Matrix
inverse mat = map (map (/ det mat)).transpose $ [ [ cofactorExpand i j mat | j <- [1..(length.head $ mat)]] | i <- [1..length mat]]

det :: Matrix -> Double
det [[a]] = a
det list = sum $ zipWith (*) (head list) $ map (\j -> cofactorExpand 1 j list) [1..(length.head $ list)]

cofactorExpand :: Int -> Int -> Matrix -> Double
cofactorExpand i j = (* (-1)^(i+j)).det.rm i.map (rm j)

rm :: Int -> [a] -> [a]
rm n list
  | n == 1 = tail list
  | n == length list = init list
  | otherwise = take (n-1) list ++ drop n list