Codeforces Beta Round 83 (Div. 2 Only)
A
Palindromic Times
Codeforces
1000
原题
←B →
翻译中…

Tattah is asleep if and only if Tattah is attending a lecture. This is a well-known formula among Tattah's colleagues.

翻译中…

On a Wednesday afternoon, Tattah was attending Professor HH's lecture. At 12:21, right before falling asleep, he was staring at the digital watch around Saher's wrist. He noticed that the digits on the clock were the same when read from both directions i.e. a palindrome.

翻译中…

In his sleep, he started dreaming about such rare moments of the day when the time displayed on a digital clock is a palindrome. As soon as he woke up, he felt destined to write a program that finds the next such moment.

翻译中…

However, he still hasn't mastered the skill of programming while sleeping, so your task is to help him.

翻译中…

Input

翻译中…

The first and only line of the input 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

翻译中…

Print the palindromic time of day that comes soonest after the time given in the input. If the input time is palindromic, output the soonest palindromic time after the input time.

翻译中…

样例

Input #1
12:21
Output #1
13:31
InputCopy OutputCopy
Input #2
23:59
Output #2
00:00
InputCopy OutputCopy
题目信息
题号
108A
时间限制
2 s
内存限制
256 MB
标签
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。