#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
 
struct Point{
    double x,y,z;
    Point(double x, double y, double z):x(x), y(y), z(z){}
    Point(){}
    Point &operator +=(const Point &a){ x+=a.x; y+=a.y; z+=a.z; return *this; }
    Point &operator -=(const Point &a){ x-=a.x; y-=a.y; z-=a.z; return *this; }
    Point &operator *=(const double &a){ x*=a; y*=a; z*=a; return *this; }
    Point operator +(const Point &a) const{ return Point(x+a.x, y+a.y, z+a.z); }
    Point operator -(const Point &a) const{ return Point(x-a.x, y-a.y, z-a.z); }
    Point operator *(const double &a) const{ return Point(a*x, a*y, a*z); }
};
struct Obj{
    Point p;
    double r;
    Obj(Point &p, double r):p(p), r(r){}
    Obj(){}
};
 
double dot(const Point &a, const Point &b){
    return a.x*b.x +a.y*b.y +a.z*b.z;
}
Point cross(const Point &a, const 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);

}
double Length(const Point &a){
    return sqrt(dot(a, a));
}
 
int main(){
    int x,y,z;
    cin >> x >> y >> z;
    Point s(x,y,z);
    cin >> x >> y >> z;
    Point t(x,y,z);
    vector<Point> tri(3);
    for(int i=0; i<3; i++){
        cin >> x >> y >> z;
        tri[i] = Point(x,y,z);
    }

    Point n = cross(tri[1]-tri[0], tri[2]-tri[0]);
    n *= 1/Length(n);
    bool shut = false;
    if(abs(dot(n, t-s)) > EPS){
        double A = dot(s-tri[0], n);
        double B = dot(t-tri[0], n);
        if(A*B < EPS){
            Point m = s + (t-s)*(abs(A)/(abs(A)+abs(B)));
            double area = Length(cross(tri[1]-tri[0], tri[2]-tri[0]));
            double area2 = 0;
            for(int i=0; i<3; i++){
                area2 += Length(cross(tri[i]-m, tri[(i+1)%3]-m));
            }
            if(abs(area -area2) < EPS){
                shut = true;
            }
        }
    }
    if(shut){
        cout << "MISS" << endl;
    }else{
        cout << "HIT" << endl;
    }
    return 0;
}
