#include<bits/stdc++.h>
using namespace std;
const double eps = 0.0000000001;
pair<double,int> Pair;

bool eq(double a,double b){
  return ( fabs(a-b) < eps );
}

struct Point{
  double x,y,z;
  
  Point operator + (Point p){
    return (Point){x+p.x,y+p.y,z+p.z};
  }

  Point operator - (Point p){
    return (Point){x-p.x,y-p.y,z-p.z};
  }
  
  Point operator * (double k){
    return (Point){x*k,y*k,z*k};
  }
};
typedef Point Vector;


void pr(Point p){
  printf("%.5f %.5f %.5f\n",p.x,p.y,p.z);
}


double abs(Point p){
  return sqrt( p.x*p.x + p.y*p.y + p.z*p.z );
}

double dot(Point a,Point b){
  return a.x*b.x + a.y*b.y + a.z*b.z;
}

Point cross(Point a,Point b){
  double nx=a.y*b.z-b.y*a.z;
  double ny=a.z*b.x-b.z*a.x;
  double nz=a.x*b.y-b.x*a.y;
  return (Point){nx,ny,nz};
}

bool eq(Point a,Point b){
  return ( eq(a.x,b.x) && eq(a.y,b.y) && eq(a.z,b.z) );
}

struct Segment{
  Point p, v;
};
typedef Segment Line;

struct Plane{
  Point p, v1, v2;
};

bool isParallel(Plane a,Line b){  
  Vector cra=cross(a.v1,a.v2);
  return eq( dot(cra,b.v) ,0);
}


Point getCrossPoint(Plane a,Line b){
  assert( !isParallel(a,b) );
  vector<  vector<double> > G( 3, vector<double>(4) );
  G[0][0]=a.v1.x;
  G[0][1]=a.v2.x;
  G[0][2]=-b.v.x;
  G[0][3]=-(a.p.x-b.p.x);
  
  G[1][0]=a.v1.y;
  G[1][1]=a.v2.y;
  G[1][2]=-b.v.y;
  G[1][3]=-(a.p.y-b.p.y);

  G[2][0]=a.v1.z;
  G[2][1]=a.v2.z;
  G[2][2]=-b.v.z;
  G[2][3]=-(a.p.z-b.p.z);

  /*
  for(int i=0;i<3;i++){
    for(int j=0;j<4;j++){
      G[i][j]+=0.0;
      printf("%.5f ",G[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  */
  for(int i=0;i<3;i++){
    int pivot=-1;
    for(int j=0;j<3;j++)
      if( !eq(G[j][i],0) )pivot=j;
    if(pivot==-1)continue;
    
    
    swap(G[i],G[pivot]);
    
    double k=G[i][i];
    for(int j=0;j<4;j++)G[i][j]/=k;
    
    for(int j=0;j<3;j++){
      if(j==i)continue;
      double rate=G[j][i];
      for(int k=0;k<4;k++){
        G[j][k] -= G[i][k]*rate;
      }
    }
  }
  /*
  for(int i=0;i<3;i++){
    for(int j=0;j<4;j++){
      G[i][j]+=0.0;
      printf("%.5f ",G[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  */
  if(eq(G[2][0],0) && eq(G[2][1],0) && eq(G[2][2],1)){
    return b.p + b.v * G[2][3];
  }else{
    return (Point){0,0,0};
  }
}

double getTime(Line a,Point b){
  b.x -= a.p.x;
  b.y -= a.p.y;
  b.z -= a.p.z;
  if( !eq(a.v.x,0) )return b.x/a.v.x;
  if( !eq(a.v.y,0) )return b.y/a.v.y;
  if( !eq(a.v.z,0) )return b.z/a.v.z;
  return 1e30;
}


void scan(Point &p){
  cin>>p.x>>p.y>>p.z;
}



string solve(){
  Point a1,a2,a3;
  Plane a;
  Point b1,b2;
  Line b;
  scan(b1);
  scan(b2);
  b.p=b1;
  b.v=b2-b1;
  scan(a1);
  scan(a2);
  scan(a3);
  a.p=a1;
  a.v1=a2-a1;
  a.v2=a3-a1;

  double sum=0,sum2=abs(cross(a.v1,a.v2));
  sum+= abs( cross(a1-b2,a2-b2) );
  sum+= abs( cross(a2-b2,a3-b2) );
  sum+= abs( cross(a3-b2,a1-b2) );
  if(eq( sum , sum2 ))return "MISS";
  
  
  if( isParallel(a,b) )return "HIT";
  


  Point c=getCrossPoint(a,b);

  double t=getTime(b,c);
  if(t < 0 || t > 1)return "HIT";
  
  sum=0;
  sum+= abs( cross(a1-c,a2-c) );
  sum+= abs( cross(a2-c,a3-c) );
  sum+= abs( cross(a3-c,a1-c) );
  
  return (eq(sum, abs(cross(a.v1,a.v2)))?"MISS":"HIT");
}

int main(){
  cout<<solve()<<endl;
  return 0;
}