import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;

double[] cross(double[] a, double[] b) {
	return [a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]];
}
double dot(double[] a, double[] b) {
	return a[0]*b[0]+a[1]*b[1]+a[2]*b[2];
}
double norm(double[] a) {
	return sqrt(dot(a,a));
}

double[] readv() {
	auto s = readln().strip().split();
	return [to!double(s[0]),to!double(s[1]), to!double(s[2])];
}
void main() {
	auto a = readv();
	auto b = readv();
	auto A = readv();
	auto B = readv();
	auto C = readv();
	A[] -= C[];
	B[] -= C[];
	a[] -= C[];
	b[] -= C[];
	auto n = cross(A,B);
	auto k = -dot(n,b)/(dot(n,a)-dot(n,b));
	if(k < 0 || 1 < k) {
		writeln("HIT");
	} else {
		auto c = a.dup;
		c[] *= k;
		c[] += b[]*(1-k);
		auto S1 = norm(cross(A,B));
		auto A_ = A.dup;
		auto B_ = B.dup;
		A_[] -= c[];
		B_[] -= c[];
		auto S2 = norm(cross(A,c))+norm(cross(B,c))+norm(cross(A_,B_));
		double eps = 1e-5;
		if(abs(S1-S2) < eps)
			writeln("MISS");
		else
			writeln("HIT");
	}
}