P13887 [CodeChef] qucobic
NOI
题目描述

STATEMENT

You are sitting in your class getting bored and wondering how long will it be before you can get back to your room and contine solving the
current long challenge @ codechef. You look at the clock and it shows the time as HH:MM (24-hour format). Just to pass the time you
consider the problem of what maximal time the clock could display S seconds from now.

INPUT

The first line will contain an integer T, denoting the number of test cases.

Each test case contains two lines.

The first line of each test case will contain a string of length four, depicting the current time on the clock, HHMM.

The second line contains an integer S.

1 <= T <= 100
00 <= HH <= 23
00 <= MM <= 59
00 <= S <= 1000000000
OUTPUT

For each test case, print one line depicting the maximal time on the clock after S seconds.

EXAMPLE

INPUT
3
1234
123
1234
120
0000
0

OUTPUT
1237
1236
0000

输入格式

见题面

输出格式

见题面

样例输入
3 1234 123 1234 120 0000 0
样例输出
1237 1236 0000