#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout<<fixed<<setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

ll Sarrus(const ll a[3][3])
{
	return
		a[0][0] * a[1][1] * a[2][2]
		+ a[0][2] * a[1][0] * a[2][1]
		+ a[0][1] * a[1][2] * a[2][0]
		- a[0][2] * a[1][1] * a[2][0]
		- a[0][0] * a[1][2] * a[2][1]
		- a[0][1] * a[1][0] * a[2][2];
}
bool Cremer(const ll a[3][3], const ll b[3], double x[3])
{
	ll det = Sarrus(a);
	if (det != 0) {
		ll temp[3][3]; REP(i, 3) REP(j, 3)temp[i][j] = a[i][j];
		REP(i, 3) {
			REP(j, 3) temp[j][i] = b[j];
			x[i] = (double)Sarrus(temp) / det;
			REP(j, 3)temp[j][i] = a[j][i];
		}
		return true;
	}
	return false;
}
signed main()
{
	ll
		xa = in(), ya = in(), za = in(),
		xb = in(), yb = in(), zb = in(),
		x1 = in(), y1 = in(), z1 = in(),
		x2 = in(), y2 = in(), z2 = in(),
		x3 = in(), y3 = in(), z3 = in();
	ll a[3][3] =
	{
		{x2 - x1,x3 - x1,xa - xb},
		{y2 - y1,y3 - y1,ya - yb},
		{z2 - z1,z3 - z1,za - zb}
	};
	ll b[3] =
	{
		xa - x1,
		ya - y1,
		za - z1
	};
	double x[3];
	if (!Cremer(a, b, x)) cout << "HIT" << endl;
	else cout << (
		0 <= x[0] && x[0] <= 1 &&
		0 <= x[1] && x[1] <= 1 &&
		0 <= 1 - x[0] - x[1] && 1 - x[0] - x[1] <= 1 &&
		0 <= x[2] && x[2] <= 1
		? "MISS" : "HIT") << endl;
}
