#include <iostream>
using namespace std;

double px[3],py[3],pz[3];

int hantei(double x,double y,double z) {
	int i,j;
	double vx[3],vy[3],vz[3];
	for (i=0;i<3;i++) {
		j=(i+1) % 3;
		vx[i]=(py[j]-py[i])*(pz[j]-z)-(pz[j]-pz[i])*(py[j]-y);
		vy[i]=(pz[j]-pz[i])*(px[j]-x)-(px[j]-px[i])*(pz[j]-z);
		vz[i]=(px[j]-px[i])*(py[j]-y)-(py[j]-py[i])*(px[j]-x);
	}
	for (i=0;i<3;i++) {
		j=(i+1) % 3;
		if (vx[i]*vx[j]+vy[i]*vy[j]+vz[i]*vz[j]<0) break;
	}
	if (i==3) return 1; else return 0;
}

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