#include <cstdio>
#include <valarray>
#include <complex>
#include <cmath>
#include <vector>
using namespace std;

typedef complex<double> C;
typedef valarray<double> P;

#define EPS 1e-8

void assign(P &p, double x, double y, double z){
	p.resize(3);
	p[0] = x;
	p[1] = y;
	p[2] = z;
}

P cross(const P &a, const P &b){
	return a.cshift(1) * b.cshift(-1) - a.cshift(-1) * b.cshift(1);
}

P base(3);
P pts[5];

void rot(P &p, int i1, int i2, const C &r){
	C z(p[i1], p[i2]);
	z *= r;
	p[i1] = real(z);
	p[i2] = imag(z);
}

void corrot(int i1, int i2){
	C z(base[i1], base[i2]);
	C r = polar(1.0, -arg(z));
	rot(base, i1, i2, r);
	for(int i = 0; i < 5; ++i){
		rot(pts[i], i1, i2, r);
	}
}

double dot(const C &a, const C &b){
	return real(a) * real(b) + imag(a) * imag(b);
}

double cross(const C &a, const C &b){
	return real(a) * imag(b) - imag(a) * real(b);
}

double distance_ls_p(const C &a, const C &b, const C &c){
	if(dot(b - a, c - a) <= 0.0) return abs(c - a);
	if(dot(a - b, c - b) <= 0.0) return abs(c - b);
	return abs(cross(b - a, c - a)) / abs(b - a);
}

bool contains(const vector<C> &plg, const C &pt){
	int cnt = 0;
	double y = imag(pt);

	for(int i = 0; i < plg.size(); ++i){
		int j = (i + 1 == plg.size() ? 0 : i + 1);

		if(distance_ls_p(plg[i], plg[j], pt) < EPS){
			return true;
		}

		double dyi = imag(plg[i]) - y;
		double dyj = y - imag(plg[j]);
		double tx = (dyi * real(plg[j]) + dyj * real(plg[i])) / (dyi + dyj);

		if(imag(plg[i]) >= y && imag(plg[j]) < y){
			if( tx < real(pt) ) ++cnt;
		}
		else if(imag(plg[i]) < y && imag(plg[j]) >= y){
			if( tx < real(pt) ) ++cnt;
		}
	}
	
	return (cnt % 2 != 0);
}

int main(){
	double x, y, z;
	while(1){
		for(int i = 0; i < 5; ++i){
			if(scanf("%lf%lf%lf", &x, &y, &z) == EOF){
				return 0;
			}
			assign(pts[i], x, y, z);
		}

		base = cross(pts[2] - pts[3], pts[3] - pts[4]);
		corrot(2, 0);
		corrot(2, 1);

		bool hit = true;
		P v = pts[1] - pts[0];
		if(abs(v[2]) > EPS){
			double t = -pts[0][2] / v[2];
			P u = pts[0] + t * v;
			vector<C> tri;
			for(int i = 2; i < 5; ++i){
				tri.push_back(C(pts[i][0], pts[i][1]));
			}
			
			hit = !contains(tri, C(u[0], u[1]));
		}
		
		puts(hit ? "HIT" : "MISS");
	}
}