#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const double PI = acos(-1);
const double EPS = 1e-10;
int sgn(double d) { return d > EPS ? 1 : d < -EPS ? -1 : 0; }

struct Point3D {
  double x, y, z;
  Point3D(double x = 0.0, double y = 0.0, double z = 0.0) : x(x), y(y), z(z) {}
};
using Vector3D = Point3D;

Point3D operator + (const Point3D &p, const Point3D &q) { return Point3D(p.x + q.x, p.y + q.y, p.z + q.z); }
Point3D operator - (const Point3D &p, const Point3D &q) { return Point3D(p.x - q.x, p.y - q.y, p.z - q.z); }
Point3D operator * (const Point3D &p, double a) { return Point3D(p.x * a, p.y * a, p.z * a); }
Point3D operator * (double a, const Point3D &p) { return Point3D(a * p.x, a * p.y, a * p.z); }
Point3D operator / (const Point3D &p, double a) { return Point3D(p.x / a, p.y / a, p.z / a); }
double operator * (const Point3D &p, const Point3D &q) { return p.x * q.x + p.y * q.y + p.z * q.z; }
Point3D operator ^ (const Point3D &p, const Point3D &q) { return Point3D(p.y * q.z - p.z * q.y, p.z * q.x - p.x * q.z, p.x * q.y - p.y * q.x); }
double abs(const Point3D &p) { return sqrt(p * p); }
istream &operator >> (istream &is, Point3D &p) { return is >> p.x >> p.y >> p.z; }

struct Segment3D : vector<Point3D> {
  Segment3D(const Point3D &p = Point3D(), const Point3D &q = Point3D()) {
    this->emplace_back(p);
    this->emplace_back(q);
  }
};

struct Plane : vector<Point3D> {
  Plane(const Point3D &p = Point3D(), const Point3D &q = Point3D(), const Point3D &r = Point3D()) {
    this->emplace_back(p);
    this->emplace_back(q);
    this->emplace_back(r);
  }
};

vector<Point3D> crossPointSPL(const Segment3D &s, const Plane &pl) {
  Point3D n = (pl[1] - pl[0]) ^ (pl[2] - pl[0]);
  double base_length = (s[1] - s[0]) * n;
  if (!sgn(base_length)) return vector<Point3D>();
  double cross_length = (pl[0] - s[0]) * n;
  double ratio = cross_length / base_length;
  if (sgn(ratio) < 0 || sgn(ratio - 1) > 0) return vector<Point3D>();
  return vector<Point3D>(1, s[0] + (s[1] - s[0]) * ratio);
}

double area(const Point3D &p, const Point3D &q, const Point3D &r) {
  return abs((q - p) ^ (r - p)) / 2;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  Point3D from, to, bar[3];
  cin >> from >> to;
  for (int i = 0; i < 3; i++) {
    cin >> bar[i];
  }
  Segment3D s(from, to);
  Plane pl(bar[0], bar[1], bar[2]);
  auto cps = crossPointSPL(s, pl);
  if (cps.empty()) {
    cout << "HIT" << endl;
  } else {
    Point3D cp = cps[0];
    double S = 0;
    for (int i = 0; i < 3; i++) {
      S += area(cp, bar[i], bar[(i + 1) % 3]);
    }
    cout << (sgn(S - area(bar[0], bar[1], bar[2])) ? "HIT" : "MISS") << endl;
  }

  return 0;
}
