There are many handsome single boys in our team, for example, me. Some times, we like count singles. For example, in the famous “November 11th” (11.11), there are four singles ,so, single is actually 1. For another example, there are 2 singles in the time “1:01”. We are all boring guys, and here is an boring problem. Time is in the format HH:MM:SS; one day starts from 00:00:00, and ends at 24:00:00, we just want to know how many singles has passed till a certain time (included)
First line is the number of cases: n, the next n lines are each a time, exactly in the format described above. It's guaranteed that the time is in the right range (00:00:00 ~ 24:00:00)
For each case, just give us the answer in a single line, no extra character is needed.
3 00:00:00 00:00:01 00:00:02
0 1 1