In ECOOville there is a neighbourhood named ECOO in which there is a street named ECOO. There are a number of children who live on ECOO street and there are a number of pensioners who live on the street. There are
ECOO street is a very busy but narrow single lane street accessible to bicycles and pedestrians only. Because of this, the municipality decided to make each segment of the street (between house
However, they cannot decide on the flow of traffic on each segment. The ECOO Parents Association (EPA) wants their kids to have fun. Thus, they want the number of pairs of friends such that one friend can visit the other by taking the one-way roads (
On the other hand, the ECOO Elderly Association (EEA) does not like the noise that the children make when they are with their friends. Thus, they want to minimize
Is it possible for the municipality to direct the flow of traffic such that
Constraints
Subtask 1 [5%]
Subtask 2 [10%]
Subtask 3 [5%]
Subtask 4 [20%]
Subtask 5 [60%]
No additional constraints.
Input Specification
The first line of input contains
The next line contains
Output Specification
If it is not possible to make not happy
on one line, otherwise, print happy
on one line.
Sample Input 1
4 1 6
1 1 1 1
Sample Output 1
happy
Explanation for Sample Output 1
If all the roads are directed in the same way, for all
Sample Input 2
4 1 5
1 1 1 1
Sample Output 2
not happy
Comments