#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

typedef long long ll;
typedef unsigned long long ull;

struct P{
    P(){}
    P(double _x, double _y, double _z):x(_x), y(_y), z(_z){}
    double x, y, z;
};

double norm(const P& p){return p.x * p.x + p.y * p.y + p.z * p.z;}

P operator+(const P& lhs, const P& rhs){
    return P(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z);
}
P operator-(const P& lhs, const P& rhs){
    return P(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z);
}
P operator-(const P& p){
    return P(-p.x, -p.y, -p.z);
}
P operator*(const P& p, const double& k){
    return P(p.x*k, p.y*k, p.z*k);
}

P cross(const P& lhs, const P& rhs){
    return P(lhs.y*rhs.z-lhs.z*rhs.y, lhs.z*rhs.x-lhs.x*rhs.z, lhs.x*rhs.y-lhs.y*rhs.x);
}

double dot(const P& lhs, const P& rhs){
    return lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z;
}

const int INF = 1001001001;
const double EPS = 1e-8;

// S N E W(南北東西)
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

P pp, ep, t[3];

int main(){
    scanf("%lf %lf %lf", &pp.x, &pp.y, &pp.z);
    scanf("%lf %lf %lf", &ep.x, &ep.y, &ep.z);

    REP(i, 3){
        scanf("%lf %lf %lf", &t[i].x, &t[i].y, &t[i].z);
    }

    P n = cross(t[1]-t[0], t[2]-t[0]);
    
    double d1 = dot(n, pp-t[0]), d2 = dot(n, ep-t[0]);
    if(d1 * d2 > 0){
        puts("HIT");
    }else{
        P p = pp + (ep-pp) * (std::abs(d1) / (std::abs(d1)+std::abs(d2)));
    
        P cs[3] = {cross(t[1]-t[0], p-t[1]),
                   cross(t[2]-t[1], p-t[2]),
                   cross(t[0]-t[2], p-t[0])};
        
        if(dot(cs[0], cs[1]) > -EPS && dot(cs[0], cs[2]) > -EPS){
            puts("MISS");
        }else{
            puts("HIT");
        }
    }
}