#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define inf 1e12
#define eps 1e-10
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) {return point(x+a.x,y+a.y,z+a.z);}
	point operator -(const point &a) {return point(x-a.x,y-a.y,z-a.z);}
	point operator *(const double a) {return point(x*a,y*a,z*a);}
	void make(){	cin>>x>>y>>z; }
	void print(){ cout<<x<<' '<<y<<' '<<z<<endl; }
	double dot(point &a){ return x*a.x+y*a.y+z*a.z; }
	point cross(point &a){ return point( y*a.z-z*a.y , z*a.x - x*a.z , x*a.y - y*a.x ); }
	double norm(){ return x*x + y*y + z*z ; }
	double abs(){ return sqrt(norm()); }
};
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 );
}


int main(){
	point s,t;
	point v[3];
	s.make();
	t.make();
	for(int i = 0 ; i < 3 ; i++ ) v[i].make();
	s = s-v[0];
	t = t-v[0];
	v[1] = v[1] - v[0];
	v[2] = v[2] - v[0];
	v[0] = v[0] - v[0];
	point n = v[1].cross(v[2]);
	n =  n*(1.0/n.abs() );

	bool flag = false;
	point d = s-t;
	if( abs( n.dot( d ) ) > eps ){
		double a = n.dot( s );
		double b = n.dot( t );
		if( a * b < eps ){
			point m = ( s* ( abs(b)/ ( abs(a) + abs(b)  )  )  )+ ( t * ( abs(a)/ ( abs(a) + abs(b) ) ) );  
			double tri = v[1].cross(v[2]).abs();
			double tri_m = 0;
			for(int i=0;i<3;i++){
				point aa  = v[i]-m;
				point bb  = v[(i+1)%3]-m;
				tri_m += aa.cross( bb ).abs();
			}
			if( abs( tri_m - tri ) < eps ) flag = true;
		}
	}
	if(flag){
		cout<<"MISS"<<endl;
	}else {
		cout<<"HIT"<<endl;
	}

	return 0;
}

