Sort the fest
Submissions: 1057   Accuracy:


  Difficulty: Basic   Marks: 1

You are the social welfare manager of the fest. Some restaurant owners are also investing in your fest. You are given the menu of the two restaurants. There may be a chance of fight between them if any one of them have any item in common and you surely don't want that to happen. Each of the menu has 5 items (strings) in them. So, your task is to find out if there is any need to change the menu or let them be happy with their respective menu.

Input : 
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains 2 lines.The first line of each test case represents the space separated strings denoting the menu of Restaurant A. The second line of each test case represents the menu of Restaurant B.

Output : 
For each test case in a new line print without quotes "CHANGE" if there is any clash in the menu, else print "BEHAPPY".

Constraints :
1 ≤ T ≤ 100
Length of each indiviual string ≤ 15

Input : 
cake pastry fish candy meat
burger ham fish cake sauce
pizza chicken cake chilli candy
choco coco cabbage panner cheese

Output : 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mohit Gupta...OMG :)
Author: Mohit Gupta 4

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.