Time Travel

No attempts yetTime limit1sMemory limit256 MB

Problem

Jim and John are twins. Jim is an astronaut, and John collects really cheap watches. Each of them wears an analog watch: a 12 hour watch whose hour, minute and second hands sweep continuously around the face.

Jim flies into space at a velocity close to the speed of light, so his watch runs slow by aa seconds per day. John put a cheap battery in his fake luxury watch, so his watch runs slow by bb seconds per day.

At the moment Jim's spacecraft reaches its terminal velocity, the twins set both watches to midnight, that is, to 12:00. Some time later the two watches show exactly the same time for the first time. Find the time the watches show at that moment.

Input

The input has several lines. Each line holds two distinct integers aa and bb separated by one space. (0a,b2560 \le a, b \le 256, aba \ne b)

aa is the number of seconds Jim's watch loses per day, and bb is the number of seconds John's watch loses per day. Read the input until end of file.

Output

For each input line, print aa, bb, and the time the watches show on one line, separated by single spaces. Both watches show the same time at that moment, so print one time.

Round the time to the nearest minute and print it as HH:MM with a two digit hour. The face is a 12 hour clock, so write hour 0 as 12. The possible times run from 01:00 to 12:59.

When the seconds part of the time is exactly 30, so that either neighbouring minute is equally close, round up to the larger minute.