#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

struct vector3 { double x, y, z; };

double zero(double x) {
    return abs(x) < 1e-8 ? 0 : x;
}

vector3 crs(double x1, double y1, double z1, double x2, double y2, double z2) {
    vector3 ret = { y1*z2-z1*y2, z1*x2-x1*z2, x1*y2-y1*x2 };
    return ret;
}

double area(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) {
    x1 -= x3; x2 -= x3;
    y1 -= y3; y2 -= y3;
    z1 -= z3; z2 -= z3;
    return abs(sqrt((x1*x1+y1*y1+z1*z1) * (x2*x2+y2*y2+z2*z2) - (x1*x2+y1*y2+z1*z2) * (x1*x2+y1*y2+z1*z2)) / 2.0);
}

int main() {
    double px,py,pz,qx,qy,qz,x1,y1,z1,x2,y2,z2,x3,y3,z3;
    cin>>px>>py>>pz>>qx>>qy>>qz>>x1>>y1>>z1>>x2>>y2>>z2>>x3>>y3>>z3;
    double lx = px, ly = py, lz = pz;
    double hx = qx, hy = qy, hz = qz;
    while (1e-8 < abs(lx-hx) || 1e-8 < abs(ly-hy) || 1e-8 < abs(lz-hz)) {
        double mx = zero((lx+hx)/2.0);
        double my = zero((ly+hy)/2.0);
        double mz = zero((lz+hz)/2.0);
        double dl = area(x1,y1,z1,x2,y2,z2,lx,ly,lz) + area(x2,y2,z2,x3,y3,z3,lx,ly,lz) + area(x3,y3,z3,x1,y1,z1,lx,ly,lz);
        double dh = area(x1,y1,z1,x2,y2,z2,hx,hy,hz) + area(x2,y2,z2,x3,y3,z3,hx,hy,hz) + area(x3,y3,z3,x1,y1,z1,hx,hy,hz);
        if (dl < dh) {
            hx = mx, hy = my, hz = mz;
        } else {
            lx = mx, ly = my, lz = mz;
        }
    }
    vector3 v[3];
    v[0] = crs(x2-x1,y2-y1,z2-z1,lx-x1,ly-y1,lz-z1);
    v[1] = crs(x3-x2,y3-y2,z3-z2,lx-x2,ly-y2,lz-z2);
    v[2] = crs(x1-x3,y1-y3,z1-z3,lx-x3,ly-y3,lz-z3);
    bool MISS = true;
    for (int i=0; i<3; ++i) {
        for (int j=i+1; j<3; ++j) {
            if ((1e-6 < v[i].x && v[j].x < -1e-6) || (v[i].x < -1e-6 && 1e-6 < v[j].x)) MISS = false;
            if ((1e-6 < v[i].y && v[j].y < -1e-6) || (v[i].y < -1e-6 && 1e-6 < v[j].y)) MISS = false;
            if ((1e-6 < v[i].z && v[j].z < -1e-6) || (v[i].z < -1e-6 && 1e-6 < v[j].z)) MISS = false;
        }
    }
    cout << (MISS ? "MISS" : "HIT") << endl;
    return 0;
}