#B4191. Next Palindrome Time

    ID: 11848 Type: Default 1000ms 256MiB

Next Palindrome Time

Next Palindrome Time

In this problem, time is represented in a 24-hour format, for example, 16:45 represents 16 hours and 45 minutes. A palindrome time is defined as a valid time string ab:cd such that when read forwards or backwards, it is the same. That is, the digits satisfy \(a = d\) and \(b = c\). For instance, 14:41 is a palindrome time.

You are given the current time as \(h\) hours and \(m\) minutes. Your task is to find the first palindrome time strictly after this given time. Note that the current time itself should not be considered.

Note: The output time must be in 24-hour format with leading zeros if necessary.

inputFormat

The input consists of a single line containing two integers \(h\) and \(m\) (\(0 \leq h < 24\), \(0 \leq m < 60\)) representing the current time.

outputFormat

Output the first palindrome time (in \(hh:mm\) format) that occurs strictly after the given time.

sample

23 59
00:00