eolymp
bolt
Try our new interface for solving problems
Problems

Sahur & Imsa

Sahur & Imsa

Time limit 1 second
Memory limit 64 MiB

Midhat is a Network Security Engineer, based in Sarajevo. He is assigned to do some important consultation projects around the globe in July and August 2013. It happened that Ramadhan (the fasting month for Muslim) falls during these months for the year 2013. Midhat has to travel to several cities – Istanbul, Kuala Lumpur, Tokyo, Melbourne, Sao Paolo and Chicago. Even though it is permissible for Muslims not to fast when travelling, he prefers to continue fasting in Ramadhan. Midhat has no problem on this matter except he needs to make himself awake for sahur (early breakfast before dawn) on his own, which he is used to be waked by his mother at home.

Midhat wants to have his sahur 45 minutes before imsa’ (end time for taking sahur). He decided to set his travelling alarm clock 45 minutes before imsa’, so that he can take his sahur in time, make his Fajr prayer and ready to work early. Since he’s travelling to different parts of the world, the imsa’ time differs from one city to another. Midhat wants to set his travelling clock to wake him up on time for all the cities he visits. Help Midhat by writing a program that will take one time stamp, in 24-hour notation, and print out a new time stamp, 45 minutes earlier, also in 24-hour notation.

Note: In 24-hour time notation, it starts with 0:00 (midnight) and ends with 23:59 (one minute before midnight). In the input and output we'll ignore the leading zeros and colon for simplicity. So 0:00 will be written as 0 0.

Input data

The first line will contain number of test cases, T. After that T lines will follow, where each line will contain exactly two integers H and M (0H23, 0M59) separated by a single space, the input time in 24-hour notation. H denotes hours and M minutes.

Output data

For each test case, the output contains a line in the format Case #x: followed by a sequence of integers, where x is the case number (starting from 1) and output one line with exactly two integers, the time 45 minutes before input time.

Examples

Input example #1
4
5 0
10 10
0 30
23 47
Output example #1
Case #1: 4 15
Case #2: 9 25
Case #3: 23 45
Case #4: 23 2
Source ACM-ICPC Malaysia al-Khawārizmī National Programming Contest 2013 (al-Khawārizmī' 2013), 21-22 September 2013