Nine

No attempts yetTime limit1sMemory limit128 MB

Problem

Randall Munroe of xkcd.com observed that 9 is the most rarely used key on a microwave keypad. Let's spread the load.

A microwave time is entered as four digit keys, displayed as MM:SS. The first two digits are the minutes field and the last two are the seconds field; each field may take any value from 00 to 99 (so the seconds field is allowed to exceed 59). The time in seconds represented by an entry MM:SS is $60 \times MM + SS$.

Given a desired cooking time $T$ (in seconds), find the four-key entry whose represented time $T_9$ uses as many 9 keys as possible while keeping the error below 10%. Formally, an entry is allowed only when

$$10,|T - T_9| < T.$$

Among all allowed entries, choose the one that uses the greatest number of 9 digits. Break ties by the smallest error $|T - T_9|$, and break any remaining ties by choosing the lexicographically smallest MM:SS string.

Worked example: for $T = $ 01:15 (that is, $T = 75$ seconds), every time from $68$ to $82$ seconds has less than 10% error. Among those, 00:69, 00:79, 01:09, and 01:19 use the most 9 keys (one each). The ones with the smallest error are 00:79 and 01:19 (error $4$), and the lexicographically smaller of those is 00:79.

Input

The input contains several test cases. Each line holds one desired cooking time in MM:SS format, where every digit is between 0 and 9. The line 00:00 marks the end of the input and is not processed.

Output

For each test case, print on its own line the four keys to press, in MM:SS format.