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

const double EPS = 1e-8;

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+z*p.z; }

	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 ); }
};

Pt uaz, enemy, v[3];

double area( const Pt &a, const Pt &b, const Pt &c )
{ return (b-a).cross(c-a).norm()/2; }

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);

	double a = (enemy-uaz).x, b = (enemy-uaz).y, c = (enemy-uaz).z;
	double x0 = uaz.x, y0 = uaz.y, z0 = uaz.z;

	Pt n = (v[1]-v[0]).cross(v[2]-v[0]);
	double d = n.x, e = n.y, f = n.z;
	double x1 = v[0].x, y1 = v[0].y, z1 = v[0].z;

	if( fabs(a*d+b*e+c*f) < EPS )
	{ puts("HIT"); return 0; }

	double t = (d*(x1-x0)+e*(y1-y0)+f*(z1-z0))/(a*d+b*e+c*f);
	Pt inr( a*t+x0, b*t+y0, c*t+z0 );

	if( area(inr,v[0],v[1])+area(inr,v[1],v[2])+area(inr,v[2],v[0]) > area(v[0],v[1],v[2])+EPS )
		puts("HIT");
	else
		puts( (uaz-inr).dot(enemy-inr)>EPS ? "HIT" : "MISS" );

	return 0;
}