#P13562. 「WWOI R1」WsW 的田地
「WWOI R1」WsW 的田地
Background
WsW can be happy and angry.
Problem Description
WsW and bln each have a piece of farmland. Both farmlands consist of cells, where the top-left cell has coordinates and the bottom-right cell has coordinates .
At the beginning, in WsW's farmland, the cell at has a seedling with growth value ; in bln's farmland, the cell at has a seedling with growth value .
At the beginning of each following day, a little fairy uses a potion on the cell in either WsW's or bln's farmland. There are three types of potions:
- Potion , with parameters, increases the growth value by for every cell in that farmland that satisfies or .
- Potion , with parameters, increases the growth value by for every cell in that farmland that satisfies and .
- Potion , with parameters, increases the growth value by for every cell in that farmland that satisfies and .
The potion does not affect areas outside the farmland.
The potion takes effect instantly, and its effect does not disappear after the end of the day.
After the fairy uses a potion, WsW checks both their own farmland and bln's farmland. If, for every cell with the same coordinates in the two farmlands, the growth values are all equal, then WsW will be very happy; otherwise, WsW will be very angry.
Input Format
The first line contains two integers , representing the size of the farmlands.
The next lines each contain numbers, describing the initial growth values of the seedlings in WsW's farmland.
The next lines each contain numbers, describing the initial growth values of the seedlings in bln's farmland.
The next line contains a positive integer , meaning there are days in total.
The next lines each describe one potion use. First read two integers . Here is the potion type. If , the potion is used on WsW's farmland; if , it is used on bln's farmland. Then:
- If , it means potion is used. Then input integers .
- If , it means potion is used. Then input integers .
- If , it means potion is used. Then input integers .
Output Format
Output lines in total, describing WsW's mood after the potion is used each day.
If WsW is very happy, output Happy; if WsW is very angry, output Angry.
2 3
1 1 4
5 1 4
0 0 3
5 0 4
5
1 1 1 2 1
1 0 1 1 4
1 1 1 3 4
2 1 2 1 4 0 1
2 0 2 2 4 0 1
Happy
Angry
Angry
Angry
Happy
3 3
1 9 1
9 8 1
3 0 5
3 11 1
9 10 3
3 0 5
1
3 1 1 1 -2 1 1
Happy
Hint
Sample 1 Explanation
The red numbers indicate the growth values in the cells that change on that day.

It can be seen that only on day and day do the corresponding cells in the two farmlands have the same growth values.
Constraints
This problem uses bundled testdata.
For all testdata, it is guaranteed that:
- ,.
- For all , we have .
- , .
- , , , , .
| Subtask ID | $\lvert a_{i,j}\rvert,\lvert b_{i,j}\rvert,\lvert k\rvert\le$ | Special Restriction | Score | ||
|---|---|---|---|---|---|
| Guaranteed that there is no case with . | |||||
| ^ | None. | ||||
| Guaranteed that there is no case with . | |||||
| ^ | None. | ||||
Translated by ChatGPT 5