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

void move(double a[3], double x, double y, double z)
{
    a[0] += x;
    a[1] += y;
    a[2] += z;
}

void rotateX(double a[3], double cos, double sin)
{
    double y = cos * a[1] - sin * a[2];
    double z = sin * a[1] + cos * a[2];
    a[1] = y;
    a[2] = z;
}

void rotateY(double a[3], double cos, double sin)
{
    double x = cos * a[0] + sin * a[2];
    double z = -sin* a[0] + cos * a[2];
    a[0] = x;
    a[2] = z;
}

int zz;

int test(double p1[3], double p2[3], double p3[3], double d[2])
{
    double k, m, g;
    double a0 = p2[0] - p1[0];
    double a1 = p2[1] - p1[1];
    double a2 = p2[2] - p1[2];
    double b0 = p3[0] - p1[0];
    double b1 = p3[1] - p1[1];
    double b2 = p3[2] - p1[2];
    double d0 = d[0] - p1[0];
    double d1 = d[1] - p1[1];
    g = 1.0 / (a0 * b1 - a1 * b0);
    k = g * (b1 * d0 - b0 * d1);
    m = g * (-a1 * d0 + a0 * d1);
    zz = p1[2] + k * a2 + m * b2;
    return ((k>=0&&m>=0)? 1 : 0);
}

int main(void) {
    double c[3], t[3], p1[3], p2[3], p3[3];
    cin >> c[0]  >> c[1]  >> c[2];
    cin >> t[0]  >> t[1]  >> t[2];
    cin >> p1[0] >> p1[1] >> p1[2];
    cin >> p2[0] >> p2[1] >> p2[2];
    cin >> p3[0] >> p3[1] >> p3[2];

    move(t,  -c[0], -c[1], -c[2]);
    move(p1, -c[0], -c[1], -c[2]);
    move(p2, -c[0], -c[1], -c[2]);
    move(p3, -c[0], -c[1], -c[2]);

    while(abs(t[2]) < 1e-1) {
        double cos = 1/ sqrt(2.0);
        double sin = 1/ sqrt(2.0);
        rotateX(t, cos, sin);
        rotateX(p1, cos, sin);
        rotateX(p2, cos, sin);
        rotateX(p3, cos, sin);
        rotateY(t, cos, sin);
        rotateY(p1, cos, sin);
        rotateY(p2, cos, sin);
        rotateY(p3, cos, sin);
    }

    double h = sqrt(pow(t[1],2.0) + pow(t[2],2.0));
    double cos = t[2] / h;
    double sin = t[1] / h;
    rotateX(t, cos, sin);
    rotateX(p1, cos, sin);
    rotateX(p2, cos, sin);
    rotateX(p3, cos, sin);

    h = sqrt(pow(t[0], 2.0)+pow(t[2],2.0));
    cos = t[2] / h;
    sin = - t[0] / h;
    rotateY(t, cos, sin);
    rotateY(p1, cos, sin);
    rotateY(p2, cos, sin);
    rotateY(p3, cos, sin);

    int flag = 1;
    flag *= test(p1, p2, p3, t);
    flag *= test(p2, p1, p3, t);
    flag *= test(p3, p1, p2, t);

    if (flag == 0) {
        cout << "HIT" << endl;
    }
    else {
        if (0.0 <= t[2] && (t[2] < zz || zz < 0))
            cout << "HIT" << endl;
        else if ( t[2] <= 0.0 && (zz < t[2] || 0 < zz))
            cout << "HIT" << endl;
        else
            cout << "MISS" << endl;
    }


    return 0;
}

