#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
const double EPS = 1e-8;

struct Point{
    double x, y, z;
    Point() : x(0), y(0), z(0) {}
    Point(double x, double y, double z) : 
        x(x), y(y), z(z) {}
};

Point operator + (Point a, Point b){
    return Point(a.x + b.x, a.y + b.y, a.z + b.z);
}

Point operator - (Point a, Point b){
    return Point(a.x - b.x, a.y - b.y, a.z - b.z);
}

Point operator * (double t, Point a){
    return Point(t * a.x, t * a.y, t * a.z);
}

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

double abs(Point a){
    return sqrt(dot(a, a));
}

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


Point input() {
    double x, y, z;
    cin >> x >> y >> z;
    return Point(x, y, z);
}


int sign(double x) {
    if(x > EPS) return 1;
    if(x < -EPS) return -1;
    return 0;
}

bool iSS(Point a, Point b, Point c, Point d) {
    auto ok = [](Point a, Point b, Point c, Point d) {
        Point c1 = cross(b - a, c);
        Point c2 = cross(b - a, d);
        return sign(dot(c1, c2)) <= 0;
    };
    return ok(a, b, c, d) && ok(c, d, a, b);
}

bool solve(){
    Point A = input();
    Point B = input();
    Point p = input();
    Point q = input();
    Point r = input();
    Point normal = cross(q - p, r - p);
    double d = dot(normal, B - A);
    if(sign(d - EPS) == 0) {
        Point n2 = cross(q - p, A - p);
        if(sign(dot(normal, n2)) != 0) return false;
        if(iSS(A, B, p, q)) return true;
        if(iSS(A, B, q, r)) return true;
        if(iSS(A, B, r, p)) return true;
        return false;
    } else {
        double t = (1 - dot(normal, A)) / d;
        Point cp = A + t * (B - A);
        if(sign(t) < 0 || sign(t - 1) > 0) return false;

        Point p1 = cross(q - p, cp - p);
        Point p2 = cross(r - q, cp - q);
        Point p3 = cross(p - r, cp - r);
        if(sign(dot(p1, p2)) >= 0 && sign(dot(p1, p3)) >= 0) {
            return true;
        } else {
            return false;
        }
    }
}

int main(){
    cout << (!solve() ? "HIT" : "MISS") << endl;
    return 0;
}