// AOJ 0115
#include<cstdio>
#include<cmath>
#define rep(i,a) for(int i=0;i<(a);++i)

const double EPS = 1e-5;

struct Pt
{
	double x, y, z;

	Pt( double x = 0, double y = 0, double z = 0 )
	:	x(x), y(y), z(z)
	{}

	Pt& operator+= ( const Pt &p )
	{
		x += p.x;
		y += p.y;
		z += p.z;

		return *this;
	}

	Pt& operator-= ( const Pt &p )
	{
		x -= p.x;
		y -= p.y;
		z -= p.z;

		return *this;
	}

	Pt operator+ ( const Pt &p ) const
	{ return Pt( x+p.x, y+p.y, z+p.z ); }

	Pt operator- ( const Pt &p ) const
	{ return Pt( x-p.x, y-p.y, z-p.z ); }

	Pt operator* ( double k ) const
	{ return Pt( k*x, k*y, k*z ); }

	Pt operator/ ( double k ) const
	{ return Pt( x/k, y/k, z/k ); }

	bool operator== ( const Pt &p ) const
	{ return x==p.x && y==p.y && z==p.z; }

	double dot( const Pt &p ) const
	{ return x*p.x+y*p.y; }

	double norm() const
	{ return sqrt(x*x+y*y+z*z); }

	Pt cross( const Pt &p ) const
	{ return Pt( y*p.z-z*p.y, z*p.x-x*p.z, x*p.y-y*p.x ); }
};

struct Tri
{
	Pt p0, p1, p2;

	Tri( Pt a, Pt b, Pt c )
	:	p0(a), p1(b), p2(c)
	{}

	Pt norm()
	{
		Pt n = (p1-p0).cross(p2-p0);
	
		return n/n.norm();
	}

	double area()
	{
		double a = (p1-p0).norm(), b = (p2-p1).norm(), c = (p2-p0).norm();
		double s = (a+b+c)/2;

		return sqrt(s*(s-a)*(s-b)*(s-c));
	}
};

Pt uaz, enemy, v[3];

bool intersect( Pt &norm, Pt &inr )
{
	Pt &ap = v[0]-uaz, bp = v[0]-enemy;
	double dot_APN = ap.dot(norm), dot_BPN = bp.dot(norm);

	if( fabs(dot_APN) < EPS && fabs(dot_BPN) < EPS )
		return false;
	else if( !(dot_APN <= EPS && dot_BPN >= -EPS) && !(dot_BPN <= EPS && dot_APN >= -EPS) )
		return false;

	Pt ue = enemy-uaz;
	double h = fabs(dot_APN)/(fabs(dot_APN)+fabs(dot_BPN));

	inr.x = uaz.x + ue.x*h;
	inr.y = uaz.y + ue.y*h;
	inr.z = uaz.z + ue.z*h;

	return true;
}

int main()
{
	double x, y, z;
	scanf( "%lf%lf%lf", &x, &y, &z ); uaz = Pt(x,y,z);
	scanf( "%lf%lf%lf", &x, &y, &z ); enemy = Pt(x,y,z);
	rep( i, 3 )
		scanf( "%lf%lf%lf", &x, &y, &z ), v[i] = Pt(x,y,z);

	Tri barrier(v[0],v[1],v[2]);
	Pt norm = barrier.norm();

	bool fl = true;
	if( fabs((uaz-enemy).dot(norm)) >= EPS )
	{
		Pt inr;

		if( intersect( norm, inr ) && 
			Tri(v[0],v[1],inr).area()+Tri(v[1],v[2],inr).area()+Tri(v[2],v[0],inr).area() < barrier.area()+EPS )
			fl = false;
	}

	puts( fl?"HIT":"MISS" );

	return 0;
}