JDCC '16 Contest 2 P2 - Broken Telephone

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

A kindergarten class is playing a game of broken telephone. Sitting in a circle, the first child whisper a word to a child sitting beside him or her. That child slightly mishears the word, and passes the misheard word on. After a series of mishearings, the last person in the circle ends up with a completely different word.

However, the kids don't always play fair. Some kids purposely pass on something different from what they heard in order to get a ridiculous result in the end. Normally, at most one letter of the word is misheard, but these hooligans will change at least two letters of the word or change the length of the word.

Given the sequence of words passed on in the game, can you figure out if any child tampered with the game?

Input

The first line of input contains T (1 \le T \le 10). T test cases follow. Each test case begins with an integer N (1 \le N \le 100), the number of words passed around the circle. The next N lines each contain a word. The words appear in the order that the kids pass them on.

Output

For each test case, output Fair Game if all the children played fair, or Hooligans! if there was tampering involved.

Sample Input

2
3
DOG
DOT
LOL
4
ADD
AID
LID
LIT

Sample Output

Hooligans!
Fair Game

Comments

There are no comments at the moment.