eolymp
bolt
Try our new interface for solving problems
Problems

New Sergey's game

New Sergey's game

C-student Sergey often asks A-student Vasya to do his homework. Vasya is genius, but he still cann't cope with the work instantly, so Sergey waits. Sergey is boring long because of nothing to do. Not so long ago he came up with a new game to pass the time.

On the white table with coordinate system Sergey puts a rectangular sheet of black paper. Above it he puts a rectangular piece of white paper so that possible it overlaps a portion of the black sheet. The parties of both sheets of paper are parallel to the coordinate axes. After that, the boy chooses a point on the plane of the table. If it hits the black sheet, Serge believes that the expectations are not boring, otherwise he gets upset.

Help Sergey to understand, is he upset or not.

Input

First given the coordinates of upper left corner of black rectangle, then bottom right, the the coordinates of angles of white rectangle in the same format and at last the point's coordinates are given. All coordinates are integer, not greater than 10000 by absolute value.

Output

Print "SAD" if Sergey is sad (if the point falls on the boundary, Sergey thinks it belongs to the black sheet), and "HAPPY" otherwise.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 10 5 3 4 4 6 1 2 9
Output example #1
HAPPY
Input example #2
2 10 5 3 4 4 6 1 6 3
Output example #2
SAD