hh, mm = map(int, input().split(":")) if mm >= 55: hh += 1 mm += 5 print(f"{hh % 24:02}:{mm % 60:02}")