#include <bits/stdc++.h>
using namespace std;

#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-7;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename Ostream,typename Container>
Ostream& operator<<(Ostream& os,const Container& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

bool GaussJordan(const vvd& _a,const vd& b,vd& x)
{
	int n=_a.size();
	vvd a(n,vd(n+1));
	rep(i,n){
		copy(all(_a[i]),begin(a[i]));
		a[i][n]=b[i];
	}
	
	rep(i,n){
		int p=i;
		repi(j,i+1,n) if(abs(a[p][i])<abs(a[j][i])) p=j;
		if(abs(a[p][i])<EPS) return false;
		swap(a[i],a[p]);
		peri(j,i,n+1) a[i][j]/=a[i][i];
		rep(j,n) if(j!=i) peri(k,i,n+1) a[j][k]-=a[j][i]*a[i][k];
	}
	
	rep(i,n) x[i]=a[i][n];
	return true;
}

struct Point{
	double x,y,z;
	Point(){}
	Point(double x,double y,double z):x(x),y(y),z(z){}
	Point& operator+=(Point p){x+=p.x,y+=p.y,z+=p.z; return *this;}
	Point& operator-=(Point p){x-=p.x,y-=p.y,z-=p.z; return *this;}
	Point& operator*=(double c){x*=c,y*=c,z*=c; return *this;}
	Point& operator/=(double c){x/=c,y/=c,z/=c; return *this;}
};
Point operator+(Point a,Point b){return a+=b;}
Point operator-(Point a,Point b){return a-=b;}
Point operator*(Point a,double c){return a*=c;}
Point operator*(double c,Point a){return a*=c;}
Point operator/(Point a,double c){return a/=c;}
ostream& operator<<(ostream& os,const Point& p){
	return os<<'('<<p.x<<','<<p.y<<','<<p.z<<')';
}

int main()
{
	Point me; cin>>me.x>>me.y>>me.z;
	Point enemy; cin>>enemy.x>>enemy.y>>enemy.z;
	vector<Point> barriers(3);
	for(auto& b:barriers) cin>>b.x>>b.y>>b.z;
	
	//dump(me); dump(enemy); dump(barriers);
	
	// ビーム: p+dt (位置ベクトルp, 方向ベクトルd, 媒介変数t)
	// バリア: q+eu+fv (位置ベクトルq, 方向ベクトルe,f, 媒介変数u,v)
	Point p=me,d=enemy-me;
	Point q=barriers[0],e=barriers[1]-barriers[0],f=barriers[2]-barriers[0];
	
	// p+dt=q+eu+fvをt,u,vについて解く(x=(t,u,v))
	vvd a={{d.x,-e.x,-f.x},
				 {d.y,-e.y,-f.y},
				 {d.z,-e.z,-f.z}};
	vd b={q.x-p.x,
				q.y-p.y,
				q.z-p.z};
	vd x(3);
	GaussJordan(a,b,x);
	double t=x[0],u=x[1],v=x[2];
	
	// バリアが自分と敵の間にある
	if(-EPS<t && t<1+EPS){
		// バリアを含む平面上の点q+eu+fvを二次元平面上の点(u,v)に射影する．
		// すると，バリアを構成する3点はそれぞれ(0,0),(1,0),(0,1)に射影されているので，
		// (u,v)がこの三角形の内側にあるか判定すればよい．
		if(-EPS<u && -EPS<v && u+v<1+EPS)
			cout<<"MISS"<<endl;
		else
			cout<<"HIT"<<endl;
	}
	else
		cout<<"HIT"<<endl;
}