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

const double eps = 1e-7;
struct vector3 { double x, y, z; };

double zero(double x) {
    return x < eps ? 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*x1 };
    double len = sqrt(pow(ret.x,2)+pow(ret.y,2)+pow(ret.z,2));
    ret.x = zero(ret.x/len);
    ret.y = zero(ret.y/len);
    ret.z = zero(ret.z/len);
    return ret;
}

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 (eps < abs(lx-hx) || eps < abs(ly-hy) || eps < 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 = sqrt(pow(lx-x1,2)+pow(ly-y1,2)+pow(lz-z1,2));
        double dh = sqrt(pow(hx-x1,2)+pow(hy-y1,2)+pow(hz-z1,2));
        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 (eps < abs(v[i].x-v[j].x) || eps < abs(v[i].y-v[j].y) || eps < abs(v[i].y-v[j].y)) {
                MISS = false;
            }
        }
    }
    cout << (MISS ? "MISS" : "HIT") << endl;
    return 0;
}