Little Gyro and Derrick
题号:NC200116
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Little Gyro and Derrick are playing a wonderful game called Escape the Board on an N×M board.
Initially, there are K pieces belong to Little Gyro on the board, and Derrick has 2×(N + M) baffles.
In Little Gyro's turn, Little Gyro can move his pieces to the neighbouring (by side) cells. If the pieces lies at the border of the board then Little Gyro can move it outside the board and win the game.
Every time after Little Gyro's move, Derrick bans one edge with his baffle as shown in the figure below. Little Gyro can't move his pieces through the baffle. If Little Gyro can't move any piece outside the board, then Derrick wins.

Given the size of the N×M board, and the initial coordinates of Little Gyro's K pieces, please judge whether Little Gyro will win the game or not.

输入描述:

There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case:
The first line contains three integers N, M (1 ≤ N, M ≤ 100) indicating the dimensions of the board and K (0 ≤ K ≤ 100) indicating the number of pieces.
In the following K lines, each line contains two integers x, y (1 ≤ x ≤ N, 1 ≤ y ≤ M), separated by space, indicating the coordinates of the corresponding pieces.
There could be more than one piece at a cell.

输出描述:

For each test case, if Little Gyro wins the game, print "Happy Little Gyro" (without quotes), otherwise, print "Sad Little Gyro" (without quotes) instead.
示例1

输入

复制
2
2 2 1
1 2
3 4 0

输出

复制
Happy Little Gyro
Sad Little Gyro