#include <vector>
#include <iostream>
#include <cassert>
#include <string>
#include <sstream>
#include <functional>
class Matrix {
public:
	Matrix() :vector(), x(0), y(0) {};
	Matrix(const std::vector<std::vector<int>> &v) :vector(v), x(v.at(0).size()), y(v.size()) {};
	Matrix(const int &n) :vector(n, std::vector<int>(n, 0)), x(n), y(n) {
		for (auto i = 0; i < n; ++i) {
			vector.at(i).at(i) = 1;
		}
	};
	Matrix &add(const std::vector<int> &v) {
		assert(y == 0 || x == v.size());
		vector.push_back(v);
		if (y == 0) { x = v.size(); };
		++y;
		return *this;
	}
	int dist() {
		assert(x == y);
		if (x == 1 && y == 1) {
			return vector.at(0).at(0);
		}
		else {
			int result = 0;
			for (auto i = 0; i < x; ++i) {
				result += parity(0, i) * vector.at(0).at(i) * yoinshi_sub(0, i).dist();
			}
			return result;
		}
	}
	Matrix yoinshi() {
		assert(x == y);
		Matrix result;
		for (auto i = 0; i < x; ++i) {
			std::vector<int> l;
			for (auto j = 0; j < y; ++j) {
				l.push_back(parity(j, i) * yoinshi_sub(j, i).dist());
			}
			result.add(l);
		}
		return result;
	}
	Matrix operator*(const Matrix &other) {
		assert(x == other.y);
		Matrix result;
		for (auto i = 0; i < y; ++i) {
			std::vector<int> l;
			for (auto j = 0; j < other.x; ++j) {
				int factor = 0;
				for (auto k = 0; k < x; ++k) {
					factor += vector.at(i).at(k) * other.vector.at(k).at(j);
				}
				l.push_back(factor);
			}
			result.add(l);
		}
		return result;
	}
	Matrix operator*(const int &n) {
		Matrix result(*this);
		for (auto &i : result.vector) {
			for (auto &j : i) {
				j *= n;
			}
		}
		return result;
	}
	std::string to_s() {
		std::stringstream ss;
		for (auto i : vector) {
			for (auto j : i) {
				ss << j << " ";
			}
			ss << "\n";
		}
		return ss.str();
	}
	bool check_exist(const std::function<bool(int)> &f) {
		bool result = false;
		for (auto v : vector) {
			for (auto i : v) {
				result = result || f(i);
			}
		}
		return result;
	}
	bool check_all(const std::function<bool(int)> &f) {
		bool result = true;
		for (auto v : vector) {
			for (auto i : v) {
				result = result && f(i);
			}
		}
		return result;
	}
	Matrix operator-(const Matrix &other) {
		assert(x == other.x && y == other.y);
		Matrix result(*this);
		for (auto i = 0; i < y; ++i) {
			for (auto j = 0; j < x; ++j) {
				result.vector.at(i).at(j) -= other.vector.at(i).at(j);
			}
		}
		return result;
	}
private:
	std::vector<std::vector<int>> vector;
	int x, y;
	int parity(const int &i, const int &j) {
		if (((i + j) & 1) == 0) {
			return 1;
		}
		else {
			return -1;
		}
	}
	Matrix yoinshi_sub(const int &ax, const int &ay) {
		assert(ax < x && 0 <= ax);
		assert(ay < y && 0 <= ay);
		Matrix result;
		for (auto i = 0; i < x; ++i) {
			if (i != ax) {
				std::vector<int> l;
				for (auto j = 0; j < y; ++j) {
					if (j != ay) {
						l.push_back(vector.at(i).at(j));
					}
				}
				result.add(l);
			}
		}
		assert(result.x == x - 1 && result.y == y - 1);
		return result;
	}
};

int main() {
	Matrix enemy, barrier;
	{
		int tx, ty, tz;
		std::cin >> tx >> ty >> tz;
		int n, m, l;
		std::cin >> n >> m >> l;
		enemy.add(std::vector<int>{ n - tx, m - ty, l - tz });
		for (auto i = 0; i < 3; ++i) {
			std::cin >> n >> m >> l;
			barrier.add(std::vector<int>{ n - tx, m - ty, l - tz });
		}
	}
	auto X = enemy * barrier.yoinshi() * barrier.dist();
	auto dist = barrier.dist();
	dist *= dist;
	auto lambda = [dist](const int &n)mutable->bool {return (dist -= n) > 0; };
	if (X.check_all([](const int &n)->bool {return (n > 0); }) && X.check_all(lambda)) {
		std::cout << "MISS\n";
	}
	else {
		std::cout << "HIT\n";
	}
	return 0;
}