T = input() hour=int(T[:2]) seconds=int(T[3:]) if seconds>=55: seconds = (seconds+5)%60 hour+=1 if hour ==24: hour=0 else: seconds+=5 print(str(hour).zfill(2)+":"+str(seconds).zfill(2))