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

const double eps = 1e-6;

class Vector3D {
public:
    double x, y, z;
    Vector3D(double x, double y, double z) : x(x), y(y), z(z) {}
};

Vector3D cross(Vector3D &a, Vector3D &b) {
    return Vector3D(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
}

double dot(Vector3D &a, Vector3D &b) {
    return a.x * b.x + a.y * b.y + a.z * b.z;
}

Vector3D normalize(Vector3D a) {
    double d = sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
    return Vector3D(a.x / d, a.y / d, a.z / d);
}

bool eq(Vector3D &a, Vector3D &b) {
    return abs(a.x - b.x) < eps && abs(a.y - b.y) < eps && abs(a.z - b.z) < eps;
}

int main() {
    int px, py, pz, qx, qy, qz, x[3], y[3], z[3];
    cin >> px >> py >> pz >> qx >> qy >> qz;
    for (int i=0; i<3; ++i) {
        cin >> x[i] >> y[i] >> z[i];
    }
    Vector3D AB(x[1] - x[0], y[1] - y[0], z[1] - z[0]);
    Vector3D BC(x[2] - x[1], y[2] - y[1], z[2] - z[1]);
    Vector3D CA(x[0] - x[2], y[0] - y[2], z[0] - z[2]);
    Vector3D AP(px - x[0], py - y[0], pz - z[0]);
    Vector3D AQ(qx - x[0], qy - y[0], qz - z[0]);
    Vector3D normal = normalize(cross(AB, BC));
    double t = dot(normal, AP);
    double u = dot(normal, AQ);
    if (0 < t * u) {
        cout << "MISS" << endl;
        return 0;
    } else {
        t = abs(t);
        u = abs(u);
        double rx = (double)(u * px + t * qx) / (t + u);
        double ry = (double)(u * py + t * qy) / (t + u);
        double rz = (double)(u * pz + t * qz) / (t + u);
        Vector3D AR(rx - x[0], ry - y[0], rz - z[0]);
        Vector3D BR(rx - x[1], ry - y[1], rz - z[1]);
        Vector3D CR(rx - x[2], ry - y[2], rz - z[2]);
        Vector3D v1 = normalize(cross(AB, AR));
        Vector3D v2 = normalize(cross(BC, BR));
        Vector3D v3 = normalize(cross(CA, CR));
        if (eq(v1, v2) && eq(v2, v3)) {
            cout << "MISS" << endl;
            return 0;
        }
    }
    cout << "HIT" << endl;
    return 0;
}