International Meeting

No attempts yetTime limit1sMemory limit256 MB

Problem

Zoyi Corporation has branches all over the world. YJ leads a project there and works with coworkers overseas, but he writes the meeting time only in his own time zone. His secretary MH rewrote the mail so that every recipient reads the meeting time in local time.

MH wrote down each coworker's time zone as an offset from Coordinated Universal Time (UTC). Korea is UTC+9 and New Jersey is UTC-5. One branch uses UTC+8.5, so the offset DD is not always an integer. DD is a multiple of 0.5 and satisfies 12D12-12 \le D \le 12.

Given the meeting time written in YJ's time zone and the time zones of NN coworkers, find the meeting time in each coworker's local time.

Input

The first line contains an integer NN (1N501 \le N \le 50), the number of coworkers.

The second line contains the meeting time in YJ's time zone in the format HH:MM UTC+D. A single space separates the time from the offset.

Each of the next NN lines contains one coworker's time zone in the format UTC+D.

Times use the 24-hour clock. Noon is 12:00, midnight is 00:00, and the last minute of a day is 23:59. Midnight is never written as 24:00. An offset always carries a sign, and a zero offset is written UTC+0.

Output

Print NN lines. Line ii contains the meeting time converted to coworker ii's local time in the format HH:MM, with two digits for the hour and two digits for the minute. Print only the time of day, even when the conversion moves to another date.