#include <bits/stdc++.h>

using namespace std;

const double EPS = 1e-9;

struct Point {
    double x, y, z;
    Point(double x, double y, double z) : x(x), y(y), z(z){
    }
    Point(){
    }
    
    Point operator - (const Point p){
        return (Point(x - p.x, y - p.y, z - p.z));
    }
};

typedef Point Vector;

Vector cross(Vector a, Vector b)
{
    return (Vector(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(Vector a, Vector b)
{
    return (a.x * b.x + a.y * b.y + a.z * b.z);
}

double S(Point A, Point B, Point C)
{
    Vector R = cross(A - C, B - C);
    return (sqrt(dot(R, R)) / 2);
}

Point in()
{
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    return (Point(x, y, z));
}

int main()
{
    Point u, v;
    Point t[3];
    
    u = in(); v = in();
    for (int i = 0; i < 3; i++) t[i] = in();
    
    if (fabs(S(u, t[0], t[1]) + S(u, t[1], t[2]) + S(u, t[2], t[0]) - S(t[0], t[1], t[2])) <= EPS)
        return (!printf("MISS\n"));
    
    Point n = cross(t[0] - t[1], t[1] - t[2]);
    
    if (fabs(dot(v - u, n)) < EPS){
        if (fabs(dot(t[0] - u, n)) < EPS) return (!printf("MISS\n"));
        return (!printf("HIT\n"));
    }
    double m = dot(t[0] - u, n) * 1.0 / dot(v - u, n);
    
    Point P = v - u;
    P.x *= m; P.y *= m; P.z *= m;
    P.x += u.x; P.y += u.y; P.z += u.z;
    
    if (fabs(S(P, t[0], t[1]) + S(P, t[1], t[2]) + S(P, t[2], t[0]) - S(t[0], t[1], t[2])) <= EPS)
        printf("MISS\n");
    else printf("HIT\n");
    
    return (0);
}