#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;
const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
const int Mod = 1000000000 + 0;
//{{{ templates
#define TT_ template<typename T>inline
#define TTF_ template<typename T,typename F>inline
TT_ T sq(T x){return x*x;}
TT_ T In(){T x;cin>>x;return x;}
TT_ void Out(T&x){cout<<x;}
TT_ void sort(T&v){sort(begin(v),end(v));}
TT_ void revs(T&v){reverse(begin(v),end(v));}
TT_ void uniq(T&v){sort(v);v.erase(unique(begin(v),end(v)),end(v));}
TT_ int ubnd(T&v,typename T::value_type x){return upper_bound(begin(v),end(v),x)-begin(v);}
TT_ int lbnd(T&v,typename T::value_type x){return lower_bound(begin(v),end(v),x)-begin(v);}
TTF_ void inpt(T&v,int n,F f){for(v.reserve(n);n--;v.emplace_back(f()));}
TTF_ void show(T&v,F f,string d=" ",string e="\n"){int i=0;for(auto&x:v)i++&&(cout<<d),f(x);cout<<e;}
TT_ typename T::iterator minel(T&v){return min_element(begin(v),end(v));}
TT_ typename T::iterator maxel(T&v){return max_element(begin(v),end(v));}

inline void fast_io(){ios_base::sync_with_stdio(0);cin.tie(0);}
inline int in(){int x;scanf("%d",&x);return x;}
inline ll pow_mod(ll a,ll k,ll m){ll r=1;for(;k>0;a=a*a%m,k>>=1)if(k&1)r=r*a%m;return r;}
inline ll mod_inv(ll a,ll p){return pow_mod(a,p-2,p);}
//}}} priority_queue queue deque front stringstream max_element min_element insert count make_tuple

const ld EPS = 1e-10;

struct V {
  ld x, y, z;
  V(){}
  V(ld x, ld y, ld z) : x(x), y(y), z(z) {}
  void read(){
    cin >> x >> y >> z;
  }
};

V operator-(const V& a, const V& b){
  return V(a.x - b.x, a.y - b.y, a.z - b.z);
}

ld dot(V a, V b){return a.x*b.x+a.y*b.y+a.z*b.z;}
V cross(V a, V b){return V(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x);}

bool intersect(V x, V d, V p0, V p1, V p2)
{
  V e1, e2, p, q;
  ld det, u, v;

  e1 = p1 - p0;
  e2 = p2 - p0;
  p = cross(d, e2);
  det = dot(e1, p);
  if (det > EPS){
    u = dot(x - p0, p);
    if (u < 0.0 || u > det) return false;
    q = cross(x - p0, e1);
    v = dot(d, q);
    if (v < 0.0 || u + v > det) return false;
  }
  else if (det < -EPS){
    u = dot(x - p0, p);
    if (u > 0.0 || u < det) return false;
    q = cross(x - p0, e1);
    v = dot(d, q);
    if (v > 0.0 || u + v < det) return false;
  }
  else return false;
  return true;
}


int main()
{
  V uaz, enemy, v0, v1, v2;
  uaz.read();
  enemy.read();
  v0.read();
  v1.read();
  v2.read();
  if (intersect(uaz, enemy - uaz, v0, v1, v2)){
    puts("MISS");
  }
  else {
    puts("HIT");
  }
  return 0;
}