One of our famous admin of Programming Problem in Bengali group is a diehard supporter of Barcelona FC. When there is a match between Barcelona and Real Madrid he never misses it. Today there is a match between Barcelona and Real Madrid. And as usual he is in front of the TV screen. The weird fact of today’s match is – there is a GOAL in each and every second of the match (huh!!! ). All the goals may not be valid i.e. some of the goals can be done from OFF SIDE which is out of the rules.
At the end of the match our Barcelona supporter wants to make comment about the match on the famous social networking site FunCook. The comments he decided to post are - “Aaj Kemon Bodh Korcho”(without quotes) if Barcelona won the match , “Hala Madrid” (without quotes) if Real Madrid won the match or “Meh :\“( without quotes) if there is no winner.
Noticing the time of each goal, he figured out that the goals that are done from OFF SIDE are belongs to a famous series (Sorry I forgot the name of the series). Some values of that series are given below:
0, 1, 1, 2, 3, 5, 8 …. …. …. …. …. nth term
Now can you help him to decide the suitable comment?
You’re given an integer number T which denotes the number of test cases (T <=100). In each of the T line contains a string (S) of following characters (B, M). The maximum length of the string will not be greater than 10⁵. Note that, the starting index will be 0.
If the ith character is B then it denotes a goal is done by Barcelona at ith second.
If the ith character is M then it denotes a goal is done by Real Madrid at ith second.
For each of the T lines you have to print the case number first according to the format Case #X where X is the case number. Then you have to print Aaj Kemon Bodh Korcho if Barcelona won the match or Hala Madrid if Real Madrid won the match. Otherwise print Meh :\ . For more clarification see the samples below.
2 BBMMMM MMBBBB
Case #1: Hala Madrid Case #2: Aaj Kemon Bodh Korcho
Login to submit
Concept: Fibonacchi Number, Looping. Details: To solve the problem you first have to generate fibon... Read more...