#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define EPS (1e-8)

struct Vec {
	double x, y, z;
	
	Vec() {}
	Vec(double x, double y, double z) : x(x), y(y), z(z) {}
	Vec(const Vec &r) { *this = r; }
	
	Vec operator +(const Vec &r) const { return Vec(x + r.x, y + r.y, z + r.z); }
	Vec operator -(const Vec &r) const { return Vec(x - r.x, y - r.y, z - r.z); }
	Vec operator *(double r) const { return Vec(x * r, y * r, z * r); }
	Vec& operator =(const Vec &r) {
		x = r.x;
		y = r.y;
		z = r.z;
		return *this;
	}
};

double dot(const Vec &a, const Vec &b) { return a.x * b.x + a.y * b.y + a.z * b.z; }
Vec cross(const Vec &a, const Vec &b)  { return Vec(a.y * b.z - a.z  * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); }
double length(const Vec &a) { return sqrt(a.x * a.x + a.y * a.y + a.z * a.z); }


typedef Vec P;

double area(const P &a, const P &b, const P &c)  { return length(cross(b - a, c - a)) / 2.0; }

struct Line {
	P p;
	Vec v;
	Line(const P &p, const Vec &v) : p(p), v(v) {}
	
	P getPoint(double t) const { return p + v * t; }
};

struct Plane {
	P a, b, c;
	
	Plane(const P &a, const P &b, const P &c) : a(a), b(b), c(c) {}
};

vector<P> intersectionSPL(const Line &s, const Plane &pl) {
	vector<P> res;
	
	Vec no = cross(pl.b - pl.a, pl.c - pl.b);
	
	P a = s.p, b = s.getPoint(1.0);
	
	double da = dot(a - pl.a, no), db = dot(b - pl.a, no);

	if (abs(da) < EPS) da = 0.0;
	if (abs(db) < EPS) db = 0.0;
	if (da == 0.0 && db == 0.0) return res;
	else if (!(da * db <= 0.0)) return res;
	
	double t = abs(da) / (abs(da) + abs(db));
	res.push_back(s.getPoint(t));

	return res;
}


int main() {
	double x[5], y[5], z[5];
	REP(i, 5) cin >> x[i] >> y[i] >> z[i];
	
	P my(x[0], y[0], z[0]), en(x[1], y[1], z[1]);
	Plane ba(P(x[2], y[2], z[2]), P(x[3], y[3], z[3]), P(x[4], y[4], z[4]));
	
	Line beam(my, en - my);
	vector<P> v = intersectionSPL(beam, ba);
	
	if (v.empty()) puts("HIT");
	else {
		if (area(ba.a, ba.b, ba.c) - (area(ba.a, ba.b, v[0]) + area(ba.b, ba.c, v[0]) + area(ba.c, ba.a, v[0])) < -EPS)
			puts("HIT");
		else
			puts("MISS");
	}
	
	return 0;
}