## Teacher Troubles

View as PDF

Points: 5 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Mr. Ye is a teacher at his local school and he is particularly bad with names.

He can hardly remember the names of his students even after spending three months with them. Specifically, he gets very bad headaches whenever there are two or more students with the same name in his class, since he would never be able to remember who's who.

It's nearing the start of another school year, and the school had just emailed him the list of emails of the students who will be joining his class this year. He wants to figure out if he will suffer any headaches this year, but he can't go through all the emails all by himself, since Mr. Ye is a very popular teacher at the school and gets many students in his class ever year, which is why he has asked you, his favorite student, to write a program for him to determine if he will have to undergo headaches this year or not.

#### Input Specification

The first line of input will contain one integer .

The next lines will each contain the email address of the th student.

Each email address will be in the format (first name).(last name)(number)@student.tdsb.on.ca

Example: john.doe32@student.tdsb.on.ca

It is guaranteed that both the first name and last name will only contain lowercase letters.

It is guaranteed that each email address is distinct, and that each address will not be more than 100 characters in length.

#### Output Specification

If there are students with the same first name and same last name, output BIG HEADACHE

If the above is false, but there are students with the same first name but have different last names, output HEADACHE

If both of the above are false, output NO HEADACHE

#### Sample Input 1

4
john.james3@student.tdsb.on.ca
john.mackenzie12@student.tdsb.on.ca
william.mackenzie2@student.tdsb.on.ca
chris.william5@student.tdsb.on.ca

#### Sample Output 1

HEADACHE

#### Sample Input 2

3
ethan.zhu3@student.tdsb.on.ca
ethan.liu12@student.tdsb.on.ca
ethan.zhu10@student.tdsb.on.ca

#### Sample Output 2

BIG HEADACHE