Extension Cords

No attempts yetTime limit1sMemory limit128 MB

Problem

Harry the handyman wants to run a table saw and an arc welder at the same time at his work location. Because each draws a lot of current, they must be plugged into outlets on two different electrical circuits. Several outlets are available at the site, and each outlet belongs to one of several circuits. Harry owns a number of extension cords of various lengths.

By joining some of his extension cords end to end, can Harry connect the saw to one outlet and the welder to another outlet on a different circuit at the same time? Each connection is a chain of cords stretched in a straight line from an outlet to the work location, and a single cord cannot be used for both connections at once. A connection to an outlet is possible when the total length of the cords assigned to it is at least the straight-line distance from that outlet to the work location.

Input

The first line contains four numbers $x$, $y$, $n$, $m$. $x$ and $y$ are real numbers with absolute value at most $2,000$, each given with exactly one decimal place, and are the coordinates of Harry's work location. $n$ ($1 \le n \le 100$) is the number of extension cords, and $m$ ($1 \le m \le 100$) is the number of outlets.

Each of the next $n$ lines gives the length of one extension cord, a positive integer less than $500$.

Each of the next $m$ lines contains three values $a$, $b$, $c$. $a$ and $b$ are real numbers with absolute value at most $2,000$, each given with exactly one decimal place, and are the coordinates of an outlet. $c$ ($1 \le c \le 10,000$) is the circuit number that the outlet is connected to.

There are no obstructions on the floor, so a chain of cords can run in a straight line from any outlet to the work location.

Output

If Harry can connect the saw and the welder to outlets on two different circuits at the same time, print Harry can plug in his equipment. Otherwise, print Harry is helpless.