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 D is not always an integer. D is a multiple of 0.5 and satisfies −12≤D≤12.
Given the meeting time written in YJ's time zone and the time zones of N coworkers, find the meeting time in each coworker's local time.
The first line contains an integer N (1≤N≤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 N 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.
Print N lines. Line i contains the meeting time converted to coworker i'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.