#D3079. Starship UAZ Advance

    ID: 2565 Type: Default 1000ms 134MiB

Starship UAZ Advance

Starship UAZ Advance

Stellar history 2005.11.5. You are about to engage an enemy spacecraft as the captain of the UAZ Advance spacecraft. Fortunately, the enemy spaceship is still unnoticed. In addition, the space coordinates of the enemy are already known, and the "feather cannon" that emits a powerful straight beam is ready to launch. After that, I just issue a launch command.

However, there is an energy barrier installed by the enemy in outer space. The barrier is triangular and bounces off the "feather cannon" beam. Also, if the beam hits the barrier, the enemy will notice and escape. If you cannot determine that you will hit in advance, you will not be able to issue a launch command.

Therefore, enter the cosmic coordinates (three-dimensional coordinates x, y, z) of the UAZ Advance, enemy, and barrier positions, and if the beam avoids the barrier and hits the enemy, "HIT", if it hits the barrier " Create a program that outputs "MISS".

However, the barrier is only for those that look like a triangle from the Advance issue, and nothing that looks like a line segment is crushed. Barriers are also valid at boundaries containing triangular vertices and shall bounce the beam. Also, if the enemy is in the barrier, output "MISS".

Constraints

  • -100 ≤ x, y, z ≤ 100
  • The UAZ Advance and the enemy are never in the same position.

Input

The format of the input data is as follows:

The first line is the coordinates of UAZ Advance (x, y, z) (integer, half-width space delimited) The second line is the coordinates of the enemy (x, y, z) (integer, half-width space delimiter) The third line is the coordinates of vertex 1 of the barrier (x, y, z) (integer, half-width space delimiter) The fourth line is the coordinates (x, y, z) of the vertex 2 of the barrier (integer, half-width space delimiter) The fifth line is the coordinates (x, y, z) of the vertex 3 of the barrier (integer, half-width space delimiter)

Output

Output on one line with HIT or MISS.

Examples

Input

-10 0 0 10 0 0 0 10 0 0 10 10 0 0 10

Output

HIT

Input

-10 6 6 10 6 6 0 10 0 0 10 10 0 0 10

Output

MISS

inputFormat

outputFormat

outputs "MISS".

However, the barrier is only for those that look like a triangle from the Advance issue, and nothing that looks like a line segment is crushed. Barriers are also valid at boundaries containing triangular vertices and shall bounce the beam. Also, if the enemy is in the barrier, output "MISS".

Constraints

  • -100 ≤ x, y, z ≤ 100
  • The UAZ Advance and the enemy are never in the same position.

Input

The format of the input data is as follows:

The first line is the coordinates of UAZ Advance (x, y, z) (integer, half-width space delimited) The second line is the coordinates of the enemy (x, y, z) (integer, half-width space delimiter) The third line is the coordinates of vertex 1 of the barrier (x, y, z) (integer, half-width space delimiter) The fourth line is the coordinates (x, y, z) of the vertex 2 of the barrier (integer, half-width space delimiter) The fifth line is the coordinates (x, y, z) of the vertex 3 of the barrier (integer, half-width space delimiter)

Output

Output on one line with HIT or MISS.

Examples

Input

-10 0 0 10 0 0 0 10 0 0 10 10 0 0 10

Output

HIT

Input

-10 6 6 10 6 6 0 10 0 0 10 10 0 0 10

Output

MISS

样例

-10 6 6
10 6 6
0 10 0
0 10 10
0 0 10
MISS