// AOJ 0115
#include <iostream>
#include <cmath>

using namespace std;

typedef double Real;
const Real EPS = 1e-10;

struct vect {
	Real x, y, z;
	vect(Real x = 0, Real y = 0, Real z = 0) : x(x), y(y), z(z) {}
	void add(vect& a){
		x += a.x;
		y += a.y;
		z += a.z;
	}
	void sub(vect& a){
		x -= a.x;
		y -= a.y;
		z -= a.z;
	}
	void mul(Real a){
		x *= a;
		y *= a;
		z *= a;
	}
	Real dot(vect& a){
		return (x * a.x + y * a.y + z * a.z);
	}
	Real length(){
		return sqrt(x * x + y * y + z * z);
	}
	Real dist(vect& a){
		vect c = *this;
		c.sub(a);
		return c.length();
	}
	Real& access(int a){
		a %= 3;
		if (a == 0) return x;
		if (a == 1) return y;
		if (a == 2) return z;
		return x;
	}
	vect cross(vect& a){
		vect ret;
		vect u = *this, v = a;
		ret.x = u.y * v.z - u.z * v.y;
		ret.y = u.z * v.x - u.x * v.z;
		ret.z = u.x * v.y - u.y * v.x;
		return ret;
	}
};

struct tri{
	vect p0, p1, p2;
	tri(vect a, vect b, vect c) : p0(a), p1(b), p2(c) {}
	vect normal(){
		vect v1 = p0, v2 = p1;
		v1.sub(p1); v2.sub(p2);

		vect cross;
		for (int i = 0; i < 3; i++){
			cross.access(i) = v2.access(i + 1) * v1.access(i + 2) -
							  v2.access(i + 2) * v1.access(i + 1);
		}
		Real leng = cross.length();
		if (leng == 0.0){
			return vect();
		}
		for (int i = 0; i < 3; i++){
			cross.access(i) /= leng;
		}
		return cross;
	}
};

int main()
{
	Real x, y, z;

	cin >> x >> y >> z;		vect uaz_(x, y, z);
	cin >> x >> y >> z;		vect enemy_(x, y, z);
	cin >> x >> y >> z;		vect v1_(x, y, z);
	cin >> x >> y >> z;		vect v2_(x, y, z);
	cin >> x >> y >> z;		vect v3_(x, y, z);

	tri barrier(v1_, v2_, v3_);
	Real dst = uaz_.dist(enemy_);

	vect n = barrier.normal();
	vect uaz = uaz_, v1 = v1_;
	vect v = uaz_;

	v.sub(enemy_);
	uaz.sub(v1);

	bool ok = true;
	if (abs(v.dot(n)) < EPS){
		// cout << "zero" << endl;
	}
	else {
		Real t = (uaz.dot(n)) / (v.dot(n));
		// cout << "DEBUG ***" << t << " " << dst << endl;
		if (t < 0){
			// cout << "back" << endl;
			ok = false;
		}
		else if (t < dst + EPS){
			// cout << "over" << endl;
			ok = false;
		}

		vect p = uaz_, tmp = uaz_;
		tmp.sub(enemy_);
		tmp.mul(t);
		p.add(tmp);

		// 1
		vect d0 = uaz_; d0.sub(v1_);
		vect d1 = v2_;  d1.sub(v1_);
		vect cr = d0.cross(d1);
		if (abs(cr.dot(n)) < EPS) ok = false;

		// 2
		d0 = uaz_; d0.sub(v2_);
		d1 = v3_;  d1.sub(v2_);
		cr = d0.cross(d1);
		if (abs(cr.dot(n)) < EPS) ok = false;

		// 3
		d0 = uaz_; d0.sub(v3_);
		d1 = v1_;  d1.sub(v3_);
		cr = d0.cross(d1);
		if (abs(cr.dot(n)) < EPS) ok = false;
	}
	if (ok){
		cout << "HIT" << endl;
	}
	else {
		cout << "MISS" << endl;
	}

	return 0;
}