#include <cstdio>
using namespace std;

bool check(double p1[3], double p2[3], double v1[3], double v2[3], double v3[3]) {
  int i, p, q;
  double  a[3], b[3], c[3], d[3], n[3], m[3], x, y, z;

  for (i=0; i<3; i++) a[i] = v2[i] - v1[i];
  for (i=0; i<3; i++) b[i] = v3[i] - v1[i];
  n[0] = a[1]*b[2] - a[2]*b[1];
  n[1] = a[2]*b[0] - a[0]*b[2];
  n[2] = a[0]*b[1] - a[1]*b[0];

  for (i=0; i<3; i++) c[i] = p1[i] - v1[i];
  for (i=0, x=0.0; i<3; i++) x += c[i] * n[i];
  for (i=0; i<3; i++) d[i] = p2[i] - v1[i];
  for (i=0, y=0.0; i<3; i++) y += d[i] * n[i];
  if ((x>0.0&&y>0.0) || (x<0.0&&y<0.0)) return true;

  z = x/(x-y);
  for (i=0; i<3; i++) m[i] = (1.0-z)*c[i] + z*d[i];

  for (i=0; i<3; i++) if (n[i]<0.0) n[i] = -n[i];
  if (n[0]>n[1] && n[0]>n[2]) p=1, q=2;
  else if (n[1]>n[2]) p=2, q=0;
  else p=0, q=1;
  z = 1.0/(a[p]*b[q]-a[q]*b[p]);
  x = (b[q]*m[p]-b[p]*m[q])*z;
  y = (a[p]*m[q]-a[q]*m[p])*z;
  return (x<0.0 || y<0.0 || x+y>1.0);
}

int main() {
  int i;
  double p1[3], p2[3], v1[3], v2[3], v3[3];
  for (i=0; i<3; i++) scanf("%lf", &p1[i]);
  for (i=0; i<3; i++) scanf("%lf", &p2[i]);
  for (i=0; i<3; i++) scanf("%lf", &v1[i]);
  for (i=0; i<3; i++) scanf("%lf", &v2[i]);
  for (i=0; i<3; i++) scanf("%lf", &v3[i]);
  if (check(p1, p2, v1, v2, v3)) {
    printf("HIT\n");
  } else {
    printf("MISS\n");
  }
  return 0;
}