Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

A Big Confusion !!

Limits: 1s, 512 MB

Facebook has gone through many changes. Nowadays, Facebook has a choice of five reactions to give on a post. The reactions are - Like, Haha, Sad, Love and Angry.

Nakhla, who is a computer scientist, facing difficulties with this new reaction system. He can’t decide which reaction he should give on a post. To rescue himself, he came up with an algorithm. His newly built algorithm suggests him which reaction he should give.

The algorithm works as follows - There is a ‘clicked value’ for each of the reactions, which denotes how many times people have clicked that particular reaction for a certain post. First of all, it takes the clicked values of all reactions. Then it sorts the values in ascending order. Depending on which reaction got the most number of clicked value, the algorithm shows one of the words from the array of five single words, { “Like”, “Haha”, “Sad”, “Love”, “Angry” } . In case of multiple same highest values, his algorithm suggests the reaction which it reads first.
Now, can you determine the outputs of Nakhla’s Algorithm ?


The first line contains an integer T (T ≤ 100) indicating the number of test cases. Each test case consists of five lines. Each line will start with a string “S”, denoting the type of reaction( Like, Haha, Sad, Love, Angry) and its corresponding clicked value K (0 ≤ K ≤ 1000000).


For each test case, print the case number as “Case X: ” and print a single string according to Nakhla’s Algorithm. See the samples for exact formatting.



Haha 1
Angry 2
Sad 3
Love 4
Like 5

Angry 5
Like 4
Sad 3
Love 2
Haha 1

Like 3
Haha 5
Sad 2
Love 1
Angry 4

Case 1: Like
Case 2: Angry
Case 3: Haha