import sys try: import os f = open('input.txt', 'r') sys.stdin = f except FileNotFoundError: None from math import sqrt, ceil,floor from collections import deque, Counter, defaultdict # defaultdict(int) input=lambda: sys.stdin.readline().strip() sys.setrecursionlimit(11451419) from decimal import ROUND_HALF_UP,Decimal #変換後の末尾桁を0や0.01で指定 #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP)) from functools import lru_cache from bisect import bisect_left as bileft, bisect_right as biright from fractions import Fraction as frac #frac(a,b)で正確なa/b # @lru_cache(maxsize=10**10) #######ここまでテンプレ####### #ソート、"a"+"b"、再帰ならPython3の方がいい #######ここから天ぷら######## a,b,s = map(str ,input().split()) a=int(a);b=int(b) sa = Decimal(s[3:])-Decimal("9") # print(int(sa)) # print(sa) if sa<0: if abs(sa%1) <0.01: a+= int(sa) else: a+= floor(sa) hun = 10-int(s[-1]) # print(hun) b+= hun *6 else: a+=int(sa) b += (sa%1)*60 b=int(b) if b>=60: b-=60 a+=1 a%=24 ji = "0"+str(a) if 0<=a<=9 else str(a) hun = "0"+str(b) if 0<=b<=9 else str(b) print(ji+":"+hun)