Description
Snow is asleep if and only if Snow is attending a lecture. This is a well-known formula among Snow's colleagues. On a Wednesday afternoon, Snow was attending Professor HH's lecture. At 12:21, right before falling asleep, she was staring at the digital watch around Saher's wrist. She noticed that the digits on the clock were the same when read from both directions. She thinks such time is justice in a day. In her sleep, she started dreaming about such justice time of one day when the time displayed on a digital clock is a palindrome. As soon as she woke up, she felt destined to write a program that finds the next such moment. However, she still hasn't mastered the skill of programming while sleeping, so your task is to help her.
Input
The input contains several cases.
each case starts with a string with the format "HH:MM" where "HH" is from "00" to "23" and "MM" is from "00" to "59". Both "HH" and "MM" have exactly two digits.
Output
For each test case, you should output one line contains a justice time of day that comes soonest after the time given in the input.
Sample Input
12:21
23:59
Sample Output
13:31
00:00
代码