#include <iostream>
using namespace std;

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