A contest starts at a fixed time of day and runs for a fixed duration. For every submission, the judges must report how many minutes have elapsed since the contest began. Doing this arithmetic by hand becomes error-prone as the day wears on (how quickly can you work out the elapsed time for a 3:21 submission?).
To make this reliable, the judges precompute a lookup table before the contest and post it at the front of the room. Each row of the table corresponds to one hour value that may appear on a submission's time-stamp. When a submission arrives, the judges find the row matching the hour of the time-stamp and apply the formula in the right-hand column, where XX stands for the minute of the time-stamp, to obtain the number of elapsed minutes.
For example, for a contest starting at 12:30, a submission at 12:39 uses the row 12:XX | XX - 30, giving 39 - 30 = 9 elapsed minutes, and a submission at 3:21 uses the row 3:XX | XX + 150, giving 21 + 150 = 171 elapsed minutes.
Times use a 12-hour clock (1 through 12, no A.M./P.M.), so the hour after 12 is 1. Given the contest's starting time and duration, generate the appropriate table.
The first line contains a single integer $1 \le N \le 30$, the number of test cases. Each of the next $N$ lines contains four space-separated integers $SH$, $SM$, $DH$, $DM$. The values $1 \le SH \le 12$ and $0 \le SM \le 59$ are the hour and minute at which the contest starts. The values $0 \le DH \le 10$ and $0 \le DM \le 59$ give the contest's duration in hours and minutes. A contest lasts at least 1 minute and at most 10 hours and 59 minutes, which is why the times need no A.M./P.M. designation.
For each test case, print a table. The table begins with three header lines:
------+---------
time | elapsed
------+---------
After the header, print one line for each hour block in which a submission may occur. Each data line has the form HH:XX | formula, where HH is the hour on the 12-hour clock (the hour after 12 is 1). The hour is right-justified in a field of width two, so a single-digit hour is preceded by one space (e.g. 5:XX); the same leading space appears before the word time in the header. In the formula, XX denotes the minute of the submission: write XX when the offset is zero, XX + k when the offset is a positive $k$, and XX - k when it is a negative $-k$.
The earliest possible submission is exactly the contest's starting time (0 elapsed minutes), and the latest possible submission is when the entire duration has elapsed. Print a row for every hour block within this range. Tables for consecutive test cases follow one another with no blank line between them.