#include<iostream>
#include<cmath>
using namespace std;
const double EPS=1e-10;
struct Point{
	double x,y,z;
	Point(double x_=0,double y_=0,double z_=0):x(x_),y(y_),z(z_){}
	void input(){cin>>x>>y>>z;}
	Point operator+(Point a){return Point{x+a.x,y+a.y,z+a.z};}
	Point operator-(Point a){return Point{x-a.x,y-a.y,z-a.z};}
	Point operator*(double a){return Point{x*a,y*a,z*a};}
};
double dot(Point a,Point b){return a.x*b.x+a.y*b.y+a.z*b.z;}
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};}
double abs(Point a){return sqrt(dot(a,a));}
double area(Point a,Point b,Point c){return abs(cross(b-a,c-a))/2;}
main()
{
	Point p1,p2,a,b,c;
	p1.input();
	p2.input();
	a.input();
	b.input();
	c.input();
	Point ph=cross(b-a,c-a);
	double base=dot(p2-p1,ph);
	if(abs(base)<EPS)
	{
		cout<<"HIT"<<endl;
		return 0;
	}
	double k=dot(a-p1,ph)/base;
	if(k<-EPS||k>1+EPS)
	{
		cout<<"HIT"<<endl;
		return 0;
	}
	Point L=(p2-p1)*k+p1;
	if(area(L,a,b)+area(L,b,c)+area(L,c,a)>area(a,b,c)+EPS)
	{
		cout<<"HIT"<<endl;
		return 0;
	}
	cout<<"MISS"<<endl;
}

