using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication11 {
    class Program {


        static void Main(string[] args) {
            new Program().solve();
        }

        void solve() {

                string input1 = Console.ReadLine();
                string input2 = Console.ReadLine();
                string input3 = Console.ReadLine();
                string input4 = Console.ReadLine();
                string input5 = Console.ReadLine();
                Vector myButtler = new Vector(input1);
                Vector opponent = new Vector(input2);
                Vector bariar1 = new Vector(input3);
                Vector bariar2 = new Vector(input4);
                Vector bariar3 = new Vector(input5);

                Line l = new Line(myButtler, opponent);
                
                if (Triangle.isOnTriangle(bariar1, bariar2, bariar3, l)) {//????????¢????????????????????§??¬???????????????
                    Console.WriteLine("MISS");
                } else Console.WriteLine("HIT");//?????¢??¨????????????????????¢??¨??????????????????????????????
                Console.ReadLine();
        }

    }

    class Line {
        Vector o;//????????????
        Vector d;//??????????????????

        public Line(Vector a, Vector b) {
            o = new Vector(3, a.getComp(0), a.getComp(1), a.getComp(2));
            d = b - a;
        }

        public Vector getDirection() {
            return d;
        }

        public Vector getOne() {
            return o;
        }
    }
    
    
    class Triangle {
        const double EPS = 1e-8;

        public static bool isOnTriangle(Vector a, Vector b, Vector c, Line l) {
            Vector edge1 = b - a;
            Vector edge2 = c - a;
            Vector reverseD = new Vector(3, -l.getDirection().getComp(0), -l.getDirection().getComp(1), -l.getDirection().getComp(2));

            double den = det(edge1, edge2, reverseD);
            if (Math.Abs(den) < EPS) {
                return false;
            }

            double u = det(l.getOne() - a, edge2, reverseD) / den;
            if (u < 0 || u > 1) {
                return false;
            }

            double t = det(edge1, l.getOne() - a, reverseD) / den;
            if (t < 0 || u + t > 1) {
                return false;
            }

            double dist = det(edge1, edge2, l.getOne() - a) / den;
            if (dist < 0 || dist > 1) {
                return false;
            }

            return true;
        }

        static double det(Vector a, Vector b, Vector c) {
            return a.getComp(0) * b.getComp(1) * c.getComp(2) - a.getComp(0) * b.getComp(2) * c.getComp(1)
                + a.getComp(1) * b.getComp(2) * c.getComp(0) - a.getComp(1) * b.getComp(0) * c.getComp(2)
                + a.getComp(2) * b.getComp(0) * c.getComp(1) - a.getComp(2) * b.getComp(1) * c.getComp(0);
        }


    }

    class Vector {
        double[] x;

        public Vector(int length) {
            x = new double[length];
        }

        

        public Vector(int length,double a, double b,double c) {
            x = new double[length];
            x[0] = a;
            x[1] = b;
            x[2] = c;
        }

        public Vector(string input) {
            x = new double[3];
            string[] splited = input.Split(' ');
            for (int i = 0; i < x.Length; i++) {
                x[i] = double.Parse(splited[i]);
            }
        }

        public void setComp(double t,int idx) {
            x[idx] = t;
        }

        public double getComp(int idx) {
            return x[idx];
        }

        public static double innerProduct(Vector a, Vector b,int length) {
            double t = 0;
            for (int i = 0; i < length; i++) {
                t += a.getComp(i) * b.getComp(i);
            }
            return t;
        }

        public static Vector outerProduct(Vector a, Vector b,int length) {
            return new Vector(length, a.getComp(1) * b.getComp(2) - a.getComp(2) * b.getComp(1), a.getComp(2) * b.getComp(0) - a.getComp(0) * b.getComp(2), a.getComp(0) * b.getComp(1) - a.getComp(1) * b.getComp(0));
        }

        public static Vector normalize(Vector a) {
            double s = Math.Sqrt(Math.Pow(a.getComp(0), 2) + Math.Pow(a.getComp(1), 2) + Math.Pow(a.getComp(2), 2));
            return new Vector(3, a.getComp(0) / s, a.getComp(1) / s, a.getComp(2) / s);
        }

        public static Vector operator -(Vector a, Vector b) {
            return new Vector(3, a.getComp(0) - b.getComp(0), a.getComp(1) - b.getComp(1), a.getComp(2) - b.getComp(2));
        }
    }
    
}

Measured memory_bytes: 9224