#include <iostream>
#include <math.h>
using namespace std;

int main() {
	int i,j;
	double k,x,y,z,ax,ay,az,bx,by,bz,vx,vy,vz,a,b,c,d,s,px[3],py[3],pz[3],wx[2],wy[2],wz[2];
	cin >> ax >> ay >> az;
	cin >> bx >> by >> bz;
	vx=bx-ax; vy=by-by; vz=bz-az;
	for (i=0;i<3;i++) { cin >> px[i] >> py[i] >> pz[i];
	if (i!=0) { wx[i-1]=px[i]-px[0]; wy[i-1]=py[i]-py[0]; wz[i-1]=pz[i]-pz[0];}
    }
	a=wy[0]*wz[1]-wz[0]*wy[1]; b=wz[0]*wx[1]-wx[0]*wz[1];c=wx[0]*wy[1]-wy[0]*wx[1];
	d=-(a*px[0]+b*py[0]+c*pz[0]);
	s=-(d+a*ax+b*ay+c*az)/(a*vx+b*vy+c*vz);
	if (vx*a+vy*b+vz*c==0 || s<0) { cout << "HIT" << endl; return 0;}
	k=sqrt(a*a+b*b+c*c);
	x=ax+s*vx; y=ay+s*vy; z=az+s*vz; s=0;
	for (i=0;i<3;i++) { 
		 for (j=0;j<2;j++) { wx[j]=px[(i+j) % 3]-x; wy[j]=py[(i+j) % 3]-y; wz[j]=pz[(i+j) % 3]-z;}
		 a=wy[0]*wz[1]-wz[0]*wy[1]; b=wz[0]*wx[1]-wx[0]*wz[1]; c=wx[0]*wy[1]-wy[0]*wx[1];
		 s+=sqrt(a*a+b*b+c*c);
	 }
	 if (k<s) cout << "HIT"; else cout << "MISS";
	 cout << endl;  
	return 0;
}