#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>
#include <valarray>

using namespace std;


const double EPS = 1e-8;

typedef valarray<double> P;

void assign(P &p, double x, double y, double z)
{
    p.resize(3); // 5 -> 3
 
    p[0] = x;
    p[1] = y;
    p[2] = z;
}

double dot(const P &a, const P &b)
{
    return (a * b).sum();
}

P cross(const P &a, const P &b)
{
    return a.cshift(-1) * b.cshift(1) - a.cshift(1) * b.cshift(-1);
}

bool Solution()
{
    double x, y, z;
 
    P pt[5];
    
    for(int i = 0; i < 5; ++i)
    {
        cin>>x>>y>>z;
        
        assign(pt[i], x, y, z);
    }
    
    P n = cross(pt[3] - pt[2], pt[4] - pt[2]);
    
    double r = dot(pt[2] - pt[0], n);
    double s = dot(pt[1] - pt[0], n);
    
    if(abs(s) < EPS)
    {
        return true;
    }
    
    double t = r / s;
    
    if(t < -EPS || t > 1.0 + EPS)
    {
        return true;
    }
    
    P c = pt[0] * (1.0 - t) + pt[1] * t;
    P d = cross(pt[3] - pt[2], c - pt[2]);
    
    if(dot(d, cross(pt[4] - pt[3], c - pt[3])) < -EPS)
    {
        return true;
    }
    
    if(dot(d, cross(pt[2] - pt[4], c - pt[4])) < -EPS)
    {
        return true;
    }
    
    return false;
}

int main()
{
    cout<<(Solution() ? "HIT\n" : "MISS\n"); // don't forget the "(" ")"
    return 0;
}