#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define EPS 1e-8

using namespace std;

struct Point3D
{
	double x,y,z;

	Point3D(double x,double y,double z) : x(x),y(y),z(z) {}

	Point3D operator+(const Point3D &o)
	{
		return Point3D(x+o.x,y+o.y,z+o.z);
	}

	Point3D operator-(const Point3D &o)
	{
		return Point3D(x-o.x,y-o.y,z-o.z);
	}

	Point3D operator*(const double m)
	{
		return Point3D(x*m,y*m,z*m);
	}

	Point3D operator/(const Point3D &o)
	{
		return Point3D(x/o.x,y/o.y,z/o.z);
	}

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

	double dot(const Point3D &o)
	{
		return x*o.x + y*o.y + z*o.z;
	}
};

int main()
{
	double t1,t2,t3;
	
	cin >> t1 >> t2 >> t3;
	Point3D p(t1,t2,t3);

	cin >> t1 >> t2 >> t3;
	Point3D e(t1,t2,t3);

	vector<Point3D> v;
	rep(i,3)
	{
		cin >> t1 >> t2 >> t3;
		v.push_back(Point3D(t1,t2,t3));	
	}

	Point3D d = (v[1]-v[0]).cross(v[2]-v[0]);

	if(d.dot(p-v[0]) * d.dot(e-v[0]) > 0)
	{
		cout << "HIT" << endl;
	}
	else
	{
		Point3D p2 = p + (e-p) * (fabs(d.dot(p-v[0])) / (fabs(d.dot(p-v[0])) + fabs(d.dot(e-v[0]))));

		if((v[1]-v[0]).cross(p2-v[1]).dot((v[2]-v[1]).cross(p2-v[2])) > -EPS && (v[1]-v[0]).cross(p2-v[1]).dot((v[0]-v[2]).cross(p2-v[0])) > -EPS)
		{
			cout << "MISS" << endl;
		}
		else
		{
			cout << "HIT" << endl;
		}
	}
	return 0;
}