object Main extends App{
  import scala.collection.mutable.ListBuffer._
  import scala.io.Source._
  import scala.io.StdIn._
  import scala.collection.mutable._
  val advance = Matrix(readLine().trim().split(" ").map{s => Rational(s.toInt)}.toList)
  val enemy = Matrix(readLine().trim().split(" ").map{s => Rational(s.toInt)}.toList)
  val barrier = Matrix(readLine().trim().split(" ").map{s => Rational(s.toInt)}.toList, readLine().trim().split(" ").map{s => Rational(s.toInt)}.toList, readLine().trim().split(" ").map{s => Rational(s.toInt)}.toList)
  val barrierVec = Matrix.inverse(Matrix(barrier.toList.map{l => l.zip(advance.toList.head).map{case (a, b) => a - b}}.toSeq:_*)).map(m => m * (enemy - advance))
  println(barrierVec match{
    case Some(m) => 
      if (m.toList.exists(_.exists{_ < 0}))
        "HIT"
      else
        "MISS"
    case None => 
      "Miss"
  })
  object Rational{
    def apply(int:Int):Rational = {
      new Rational(int, 1)
    }
    def apply(num:BigInt, den:BigInt):Rational = {
      val n = if (num < 0) -num else num
      val d = if (den < 0) -den else den
      val sign = if (num * den < 0) -1 else 1
      val g = gcd(n, d)
      new Rational(sign * n / g, d / g)
    }
    
    private def gcd(a:BigInt, b:BigInt):BigInt = {
      b match{
        case _ if b == 0 => a
        case _ => gcd(b, a % b)
      }
    }
    implicit val toRational:Int => Rational = new Rational(_, 1)
  }
  class Rational(val numerator:BigInt, val denominator:BigInt){
    def +(other:Rational):Rational = Rational(numerator * other.denominator + denominator * other.numerator, denominator * other.denominator)
    def *(other:Rational):Rational = Rational(numerator * other.numerator, denominator * other.denominator)
    def -(other:Rational):Rational = this + -1 * other
    def /(other:Rational):Rational = Rational(numerator * other.denominator, denominator * other.numerator)
    def ==[A <% Rational](other:A):Boolean = numerator == other.numerator && denominator == other.denominator
    def <[A <% Rational](other:A):Boolean = (this - other).numerator < 0
    override def toString():String = s"$numerator/$denominator"
  }
  object Matrix{
    def apply(rat:List[Rational]*):Matrix = {
      new Matrix(rat.toList, rat.head.size, rat.size)
    }
    def swap[A](list:List[List[A]]):List[List[A]] = {
      list match{
        case Nil => Nil
        case l =>
          l.foldLeft((ListBuffer.empty[A], ListBuffer.empty[List[A]])){
          case ((hs, tb), (Nil)) => (hs, tb)
          case ((hs, tb), (h::Nil)) => (hs += h, tb)
          case ((hs, tb), (h::t)) => (hs += h, tb += t)
        } match {
          case (hb, tb) => hb.toList::swap(tb.toList)
        }
      }
      
    }
    def slice[A](lis:List[A]):List[List[A]] = {
      def merge(a:List[A], b:List[A]):List[A] = {
        a match{
          case Nil => b
          case h::t => merge(t, h::b)
        }
      }
      def sub(prev:List[A], next:List[A]):List[List[A]] = {
        next match{
          case Nil => Nil
          case h::t => merge(prev, t)::sub(h::prev, t)
        }
      }
      sub(Nil, lis)
    }
    def det(matrix:Matrix):Rational = {
      if (matrix.height != matrix.width) throw new Exception("Demension has not matched")
      if (matrix.height == 1) matrix.list.head.head
      else{
        swap(slice(matrix.list).head.map{a => slice(a)}).map{case a => det(new Matrix(a, matrix.height - 1, matrix.width - 1))}.zip(matrix.list.head).map{case (a, b) => a * b}.foldLeft((1, Rational(0))){case ((parity, sum),h) => (-1 * parity, sum + parity * h)}._2
      }
    }
    def inverse(matrix:Matrix):Option[Matrix] = {
      val determin = det(matrix)
      if (determin == 0) None
      else {
        val res = swap(matrix.list.map{slice(_)}).map{slice(_)}.map{a => a.map{b => det(new Matrix(b, matrix.height - 1, matrix.width - 1)) / determin}}.foldLeft((1, ListBuffer.empty[List[Rational]])){case ((parity, lb), l) => (-1 * parity, lb += l.foldLeft((parity, ListBuffer.empty[Rational])){case ((p, l), h) => (-1 * p, l += h * p)}._2.toList)}._2.toList
        Some(new Matrix(res, matrix.height, matrix.width))
      }
    }
  }
  class Matrix(private val list:List[List[Rational]], val height:Int, val width:Int){
    def +(other:Matrix):Matrix = {
      if (height != other.height || width!= other.width) throw new Exception("Demension has not match")
      new Matrix(list.zip(other.list).map{case (a, b) => a.zip(b).map{case (c, d) => c + d}}, height, width)
    }
    def -(other:Matrix):Matrix = {
      if (height != other.height || width != other.width) throw new Exception("Demension has not match")
      new Matrix(list.zip(other.list).map{case (a, b) => a.zip(b).map{case (c, d) => c - d}}, height, width)
    }
    def *(other:Matrix):Matrix = {
      if (width != other.height) throw new Exception("Demension has not match")
      new Matrix(Matrix.swap(list).map{s => other.list.map{o => s.zip(o).map{case (a, b) => a * b}.reduce{_ + _}}}, height, other.width)
    }
    def map(func:Rational => Rational):Matrix = {
      new Matrix(list.map{_.map(func)}, height, width)
    }
    def toList = list
    override def toString():String = (Matrix.swap(list).map{_.mkString(" ")}).mkString("\n")
  }
}
