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.
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.
12:21
13:31
23:59
00:00
15:51
20:02
10:44
11:11
04:02
04:40
02:11
02:20
12:15
12:21
07:07
10:01
00:17
01:10
04:55
05:50
02:17
02:20
07:56
10:01
00:29
01:10
23:31
23:32
19:30
20:02
12:14
12:21
17:32
20:02
03:44
04:40
07:15
10:01
18:42
20:02
08:56
10:01
04:50
05:50
14:32
14:41
23:23
23:32
08:35
10:01
03:32
04:40
07:59
10:01
14:12
14:41
23:52
00:00
16:36
20:02
17:50
20:02
06:59
10:01
16:50
20:02
00:00
01:10
23:59
00:00
23:33
00:00
import sys, io, os
import math
import bisect
import heapq
import string
from decimal import *
from collections import defaultdict,Counter,deque
input = sys.stdin.readline
 
def I():
    return input()
 
def II():
    return int(input())
 
def MII():
    return map(int, input().split())
 
def LI():
    return list(input().split())
 
def LII():
    return list(map(int, input().split()))
 
def GMI():
    return map(lambda x: int(x) - 1, input().split())
 
def LGMI():
    return list(map(lambda x: int(x) - 1, input().split()))
 
def WRITE(out):
  return print('\n'.join(map(str, out)))
 
def WS(out):
  return print(' '.join(map(str, out)))
 
def WNS(out):
  return print(''.join(map(str, out)))

def WSNOPRINT(out):
  return ''.join(map(str, out))

'''
'''
def minutes(s):
    h, m = s.split(':')
    h = int(h)
    m = int(m)
    return h*60 + m

def solve():
    s = '00:00,01:10,02:20,03:30,04:40,05:50,10:01,11:11,12:21,13:31,14:41,15:51,20:02,21:12,22:22,23:32'
    palindromes = s.split(',')
    t = I().strip()
    minutes_t = minutes(t)

    i = 0
    for j,p in enumerate(palindromes):
        if minutes(p) > minutes_t:
            i = j
            break
    print(palindromes[i])


solve()
