You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes.

Note that you should find only the time after a minutes, see the examples to clarify the problem statement.

You can read more about 24-hour format here https://en.wikipedia.org/wiki/24-hour_clock.


-----Input-----

The first line contains the current time in the format hh:mm (0 ≤ hh < 24, 0 ≤ mm < 60). The hours and the minutes are given with two digits (the hours or the minutes less than 10 are given with the leading zeroes).

The second line contains integer a (0 ≤ a ≤ 10^4) — the number of the minutes passed.


-----Output-----

The only line should contain the time after a minutes in the format described in the input. Note that you should print exactly two digits for the hours and the minutes (add leading zeroes to the numbers if needed).

See the examples to check the input/output format.


-----Examples-----
Input
23:59
10

Output
00:09

Input
20:20
121

Output
22:21

Input
10:10
0

Output
10:10

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
a = input()
h = int(a.split(':')[0])
m = int(a.split(':')[1])
a = int(input())
m = m + a
while m >= 60:
	h += 1
	m -= 60
while h >= 24:
	h -= 24
print(f'{h:02}:{m:02}')


import math
a = input()
h = int(a[:2])
m = int(a[3:])
a = input()
p = int(a)
hp = (m + p) // 60
mf = (m + p) % 60
hf = (hp + h) % 24
if hf < 10:
	res = '0' + str(hf) + ':'
else:
	res = str(hf) + ':'
if mf < 10:
	res = res + '0' + str(mf)
else:
	res = res + str(mf)
print(res)


from math import *
mod = 1000000007

def binpow(a, b):
	global mod
	if b == 1:
		return a % mod
	u = binpow(a, b // 2)
	if b % 2 == 0:
		return u * u % mod
	else:
		return u * u * a % mod
dic = {}

def ncr(n, r):
	if r > n - r:
		r = n - r
	if r == 0 and n == 0:
		return 1
	if r > n:
		return 0
	if n == r or r == 0:
		return 1
	if r == 1:
		return n
	key = str(n) + '|' + str(r)
	if key not in dic:
		dic[key] = ncr(n - 1, r - 1) + ncr(n - 1, r)
	return dic[key]
s = input()
n = int(input())
arr = [int(i) for i in s.split(':')]
arr[1] += n
arr[0] += arr[1] // 60
arr[1] %= 60
arr[0] %= 24
arr = [str(i).zfill(2) for i in arr]
print(arr[0], ':', arr[1], sep='')


(h, m) = map(int, input().split(':'))
a = int(input())
m += a
h += m // 60
m %= 60
h %= 24
print(str(h).rjust(2, '0'), str(m).rjust(2, '0'), sep=':')


tim = input()
m = int(input())
gh = m // 60
gm = m % 60
timsplit = tim.split(':')
hours = [i for i in range(0, 24)]
mins = [i for i in range(0, 60)]
ms = int(timsplit[1])
hs = int(timsplit[0])
if ms + gm >= 60:
	hs = (hs + gh + 1) % 24
	ms = (ms + gm) % 60
else:
	hs = (hs + gh) % 24
	ms = ms + gm
if ms < 10:
	ms = '0' + str(ms)
if hs < 10:
	hs = '0' + str(hs)
print(str(hs) + ':' + str(ms))


a = input().split(':')
m = int(input())
h = 0
m = m + int(a[1])
if m >= 60:
	h = m // 60
	m = m % 60
a[1] = m
a[0] = (int(a[0]) + h) % 24
print('{:02d}:{:02d}'.format(a[0], a[1]))


def x(i):
	if len(str(i)) == 1:
		i = '0' + str(i)
	return i
inp = input()
ext = int(input())
h = int(inp.split(':')[0])
m = int(inp.split(':')[1])
eh = int((m + ext) / 60)
em = (m + ext) % 60
oh = (eh + h) % 24
print(x(str(oh)) + ':' + x(str(em)))


hoursmin = input()
hours = int(hoursmin[:2])
minutes = int(hoursmin[3:])
a = int(input())
new_hours = str((hours * 60 + minutes + a) // 60 % 24)
new_minutes = str((hours * 60 + minutes + a) % 60)
if len(new_hours) == 1:
	new_hours = '0' + new_hours
if len(new_minutes) == 1:
	new_minutes = '0' + new_minutes
print('{}:{}'.format(new_hours, new_minutes))


(h, m) = map(int, input().split(':'))
m += int(input())
g = m // 60
m = m % 60
h += g
while h >= 24:
	h -= 24
if len(str(h)) != 2:
	h = '0' + str(h)
if len(str(m)) != 2:
	m = '0' + str(m)
print(str(h) + ':' + str(m))


__author__ = 'Utena'
time = list(map(int, input().split(':')))
n = int(input())
n = n + time[1]
time[0] = (n // 60 + time[0]) % 24
n = n % 60
time[1] = n
print(str(time[0]).zfill(2) + ':' + str(time[1]).zfill(2))


n = list(map(int, input().split(':')))
p = int(input())
t = n[0] * 60 + n[1]
t = t + p
s = t // 60
s = s % 24
w = t % 60
if s // 10 == 0:
	print('0', end='')
	print(s, end='')
else:
	print(s, end='')
print(':', end='')
if w // 10 == 0:
	print('0', end='')
	print(w, end='')
else:
	print(w, end='')


s = input()
a = int(input())
b = (10 * int(s[0]) + int(s[1])) * 60 + 10 * int(s[3]) + int(s[4])
a += b
a = a % 1440
h = a // 60
m = a % 60
a1 = str(h // 10)
a2 = str(h % 10)
a3 = str(m // 10)
a4 = str(m % 10)
o = a1 + a2 + ':' + a3 + a4
print(o)


l = list(input())
min = int(input())
s = ''
s2 = ''
hour = int(l[0]) * 10 + int(l[1])
hour += int(min / 60)
min %= 60
min += int(l[3]) * 10 + int(l[4])
if int(min / 60) >= 1:
	hour += 1
	min %= 60
hour %= 24
if hour < 10:
	s = '0' + str(hour)
else:
	s = str(hour)
if min < 10:
	s2 = '0' + str(min)
else:
	s2 = str(min)
s3 = s + ':' + s2
print(s3)


a = input()
t = int(input())
hr = int(a[:a.index(':')])
mi = int(a[a.index(':') + 1:])
v = mi + t
nm = str(v % 60)
hr += v // 60
hw = str(hr % 24)
if len(nm) == 1:
	nm = '0' + nm
if len(hw) == 1:
	hw = '0' + hw
print(hw + ':' + nm)


import math

def solve():
	arr = list(map(int, input().split(':')))
	(H, M) = (arr[0], arr[1])
	passed = int(input())
	hour = passed // 60
	mins = passed % 60
	if mins + M < 60:
		M += mins
	else:
		M += mins
		M -= 60
		hour += 1
	if hour + H < 24:
		H += hour
	else:
		H += hour
		H %= 24
	H = str(H)
	M = str(M)
	if len(H) == 1:
		H = '0' + H
	if len(M) == 1:
		M = '0' + M
	print(H + ':' + M)
solve()


def rainy(T, M):
	T = T.split(':')
	HOUR = int(T[0])
	MIN = int(T[1])
	MIN += M
	REM = MIN % 60
	HOUR += MIN // 60
	HOUR = HOUR % 24
	temp = ''
	if HOUR == 0:
		temp += '00:'
	elif HOUR < 10:
		temp += '0' + str(HOUR) + ':'
	else:
		temp += str(HOUR) + ':'
	if REM == 0:
		temp += '00'
	elif REM < 10:
		temp += '0' + str(REM)
	else:
		temp += str(REM)
	return temp
T = input()
M = int(input())
print(rainy(T, M))


chas = 0
(a, b) = map(int, input().split(':'))
c = int(input())
zz = b + c
newchas = 0
while 1:
	if zz > 60:
		zz = zz - 60
		chas = chas + 1
	if zz == 60:
		chas = chas + 1
		zz = zz - 60
	if zz < 60 or zz == 0:
		break
ee = (a + chas) * 60
while 1:
	if a + chas == 24:
		ss = 0
		n3 = ''
		if ss != 0:
			n1 = ''
		if ss != 0 and ss < 10:
			n1 = 0
		if ss == 0:
			n1 = 0
		if zz != 0:
			n2 = ''
		if zz == 0:
			n2 = 0
		if zz < 10 and zz != 0:
			n3 = 0
		print(n1, ss, ':', n3, zz, n2, sep='')
		break
	if a + chas > 24:
		ss = a + chas - 24
		while 1:
			if ss > 24:
				ss = ss - 24
			if ss == 24:
				ss = 0
			if ss < 24:
				break
		n3 = ''
		if ss != 0:
			n1 = ''
		if ss != 0 and ss < 10:
			n1 = 0
		if ss == 0:
			n1 = 0
		if zz != 0:
			n2 = ''
		if zz == 0:
			n2 = 0
		if zz < 10 and zz != 0:
			n3 = 0
		print(n1, ss, ':', n3, zz, n2, sep='')
		break
	if a + chas < 24:
		ss = a + chas
		n3 = ''
		if ss != 0:
			n1 = ''
		if ss != 0 and ss < 10:
			n1 = 0
		if ss == 0:
			n1 = 0
		if zz != 0:
			n2 = ''
		if zz == 0:
			n2 = 0
		if zz < 10 and zz != 0:
			n3 = 0
		print(n1, a + chas, ':', n3, zz, n2, sep='')
		break


import datetime

def main(args):
	(hh, mm) = list(map(int, input().split(':')))
	a = int(input())
	mm += a
	hh += mm // 60
	mm %= 60
	hh %= 24
	print(f'{hh:02d}:{mm:02d}')
	return 0
import sys
sys.exit(main(sys.argv))


s = input()
t = s[0:2]
q = s[3:5]
t1 = int(t)
q1 = int(q)
z = int(input())
t1 = t1 + z // 60
q1 = q1 + z % 60
if q1 >= 60:
	t1 = t1 + q1 // 60
	q1 = q1 % 60
	t1 = t1 % 24
t1 = t1 % 24
if t1 < 10:
	t = '0' + str(t1)
else:
	t1 = t1 % 24
	t = str(t1)
if q1 < 10:
	q1 = q1 % 60
	q = '0' + str(q1)
else:
	q = str(q1)
x = t + ':' + q
print(x)


(h, m) = tuple(map(int, input().split(':')))
a = int(input())
h = (h + (m + a) // 60) % 24
m = (m + a) % 60
if h < 10:
	print('0' + str(h), end='')
else:
	print(str(h), end='')
print(':', end='')
if m < 10:
	print('0' + str(m), end='')
else:
	print(str(m), end='')


import datetime
s = input()
m = int(input()) * 60
t1 = datetime.datetime.strptime(s, '%H:%M')
t3 = t1 + datetime.timedelta(seconds=m)
print(datetime.datetime.strftime(t3, '%H:%M'))


tm = input()
a = int(input())
hh = int(tm[:2])
mm = int(tm[3:])
h = int(a / 60)
m = a % 60
hh += h
if mm + m >= 60:
	hh += 1
mm += m
mm = mm % 60
hh = hh % 24
if hh <= 9:
	print('0' + str(hh) + ':', end='')
else:
	print(str(hh) + ':', end='')
if mm <= 9:
	print('0' + str(mm))
else:
	print(str(mm))


s = input()
a = int(input())
h = int(s[0] + s[1])
m = int(s[3] + s[4])
for i in range(a):
	m += 1
	if m == 60:
		m = 0
		h += 1
	if h == 24:
		h = 0
print(str(h // 10) + str(h % 10) + ':' + str(m // 10) + str(m % 10))


(hh, mm) = map(int, input().split(':'))
(dh, mm) = divmod(mm + int(input()), 60)
print(f'{(hh + dh) % 24:02}:{mm:02}')


(h, m) = map(int, input().split(':'))
after = int(input())
afm = h * 60 + m + after
afm %= 24 * 60
print('%.2d:%.2d' % (afm // 60, afm % 60), sep='')


(hh, mm) = map(int, input().split(':'))
m = int(input())
if m >= 1440:
	m = m % 1440
h = (mm + m) // 60
if hh + h >= 24:
	print((2 - len(str(hh + h - 24))) * '0' + str(hh + h - 24) + ':' + (2 - len(str((mm + m) % 60))) * '0' + str((mm + m) % 60))
else:
	print((2 - len(str(hh + h))) * '0' + str(hh + h) + ':' + (2 - len(str((mm + m) % 60))) * '0' + str((mm + m) % 60))


def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [int(x) for x in (f.readline() if mode == 'file' else input()).split(':')]
	[h, m] = get()
	[n] = get()
	x = h * 60 + m
	x = (x + n) % 1440
	print(str(x // 60).rjust(2, '0') + ':', end='')
	print(str(x % 60).rjust(2, '0'))
	if mode == 'file':
		f.close()
main()


from math import sqrt
n = input()
m = int(input())
time = n.split(':')
h = int(time[0])
min = int(time[1])
ore = m // 60
minute = m % 60
h = (h + ore) % 24
minutes = (min + minute) % 60
carry = (min + minute) // 60
h = (h + carry) % 24
if h < 10:
	sol = '0' + str(h)
else:
	sol = str(h)
sol += ':'
if minutes < 10:
	sol += '0' + str(minutes)
else:
	sol += str(minutes)
print(sol)


(hh, mm) = map(int, input().split(':'))
a = int(input())
mm += a
hh += mm // 60
mm %= 60
hh %= 24
mm = str(mm)
hh = str(hh)
hh = '0' * (2 - len(hh)) + hh
mm = '0' * (2 - len(mm)) + mm
print(':'.join([hh, mm]))


a = list(map(int, input().split(':')))
a[1] += int(input())
if a[1] >= 60:
	a[0] += a[1] // 60
	a[1] %= 60
if a[0] >= 24:
	a[0] %= 24
print(str(a[0]).zfill(2), ':', str(a[1]).zfill(2), sep='')


def solve():
	S = input()
	a = int(input())
	hh = int(S[:2])
	mm = int(S[3:])
	mm += a
	hh += mm // 60
	mm %= 60
	hh %= 24
	print('%02d:%02d' % (hh, mm))

def __starting_point():
	solve()
__starting_point()


(m, s) = map(int, input().split(':'))
a = int(input())
s += a
m = str((m + s // 60) % 24)
s = str(s % 60)
print(m.zfill(2), s.zfill(2), sep=':')


from sys import stdin

def read_lines(sep=' ', input_type=None):
	_lines = stdin.readlines()
	cast = input_type is not None
	lines = []
	for line in _lines:
		line = line[:-1].split(sep)
		if cast:
			line = [input_type(x) for x in line]
		lines.append(line)
	return lines
lines = read_lines(input_type=None)
hhmm = lines[0]
hhmm = hhmm[0]
offset = int(lines[1][0])
hours = int(hhmm[0:2])
mins = int(hhmm[3:5])
(d, m) = divmod(offset, 60)
hours += d
new_mins = mins + m
if new_mins >= 60:
	hours += 1
	mins = new_mins - 60
else:
	mins = new_mins
hours = hours % 24
if hours < 10:
	hours = '0' + str(hours)
else:
	hours = str(hours)
if mins < 10:
	mins = '0' + str(mins)
else:
	mins = str(mins)
print(hours + ':' + mins)


s = input().split(':')
(hour, minute) = (int(s[0]), int(s[1]))
time = int(input())
hr = time // 60
mi = time % 60
hour += hr
minute += mi
hour += minute // 60
minute %= 60
if hour >= 24:
	hour %= 24
(hour, minute) = (str(hour), str(minute))
if len(hour) == 1:
	hour = '0' + hour
if len(minute) == 1:
	minute = '0' + minute
print(hour + ':' + minute)


(s, n) = map(int, input().split(':'))
min = (s * 60 + n + int(input())) % 1440
print('%02d:%02d' % (min // 60, min % 60))


giventime = input()
toadd = int(input())
hr = int(giventime.split(':')[0]) if giventime.split(':')[0][0] != '0' else int(giventime.split(':')[0][1])
minute = int(giventime.split(':')[1]) if giventime.split(':')[1][0] != '0' else int(giventime.split(':')[1][1])
totalminutes = minute + toadd
if totalminutes < 60:
	h = 0
	outputm = totalminutes
else:
	h = totalminutes // 60
	outputm = totalminutes % 60
totalhrs = hr + h
if totalhrs < 24:
	outputh = totalhrs
else:
	while totalhrs >= 24:
		totalhrs = totalhrs - 24
	outputh = totalhrs
if len(str(outputh)) == 1:
	outputh = '0' + str(outputh)
else:
	outputh = str(outputh)
if len(str(outputm)) == 1:
	outputm = '0' + str(outputm)
else:
	outputm = str(outputm)
print(str(outputh) + ':' + str(outputm))


(h, m) = map(int, input().split(':'))
a = int(input())
m += a
if m > 59:
	h += m // 60
	m = m % 60
if h > 23:
	h = h % 24
print('0' + str(h) + ':' if h < 10 else str(h) + ':', end='')
print('0' + str(m) if m < 10 else str(m))


(hh, mm) = map(int, input().split(':'))
a = int(input())
t = (60 * hh + mm + a) % (24 * 60)
print(f'{t // 60:02}:{t % 60:02}')


string = input()
time = string.split(':')
(h, m) = (int(time[0]), int(time[1]))
t = h * 60 + m
n = int(input())
t += n
(h, m) = (str(t // 60 % 24), str(t % 60))
if len(h) == 1:
	h = '0' + h
if len(m) == 1:
	m = '0' + m
print('%s:%s' % (h, m))


__author__ = 'Logan'
strin = str(input())
time = [int(x.strip()) for x in strin.split(':')]
minutes = int(input())
time[1] += minutes
time[0] += int(time[1] / 60)
time[0] = time[0] % 24
time[1] = time[1] % 60
print('%02d:%02d' % (time[0], time[1]))


def solve(s, a):
	h = int(s[:2])
	m = int(s[3:])
	total_time = h * 60 + m
	total_time += a
	h_ = total_time // 60
	while h_ > 23:
		h_ -= 24
	h_ = str(h_)
	m_ = str(total_time % 60)
	if len(h_) == 1:
		h_ = '0' + h_
	if len(m_) == 1:
		m_ = '0' + m_
	return str(h_) + ':' + str(m_)
s = input()
a = int(input())
print(solve(s, a))


(h, m) = [int(x) for x in input().split(':')]
n = int(input())
m += n % 60
if m > 59:
	m -= 60
	h += 1
if m < 10:
	m = '0' + str(m)
h += n // 60
if h > 23:
	h %= 24
if h < 10:
	h = '0' + str(h)
print('{}:{}'.format(h, m))


(h, m) = map(int, input().split(':'))
a = (int(input()) + h * 60 + m) % 1440
print(f'{a // 60:02}:{a % 60:02}')


(h, m) = map(int, input().split(':'))
n = int(input())
m += n
eh = m // 60
m %= 60
h += eh
h %= 24
print('%02d:%02d' % (h, m))


time = input()
a = int(input())
hrs = int(time[0] + time[1])
mns = int(time[3] + time[4])
addhrs = int(a / 60)
newa = a % 60
finalmns = (newa + mns) % 60
if newa + mns >= 60:
	finalhrs = (hrs + addhrs + 1) % 24
else:
	finalhrs = (hrs + addhrs) % 24
if finalmns < 10:
	finalmns = '0' + str(finalmns)
if finalhrs < 10:
	finalhrs = '0' + str(finalhrs)
print(str(finalhrs) + ':' + str(finalmns))


(h, m) = map(int, input().split(':'))
m += int(input())
h += m // 60
m %= 60
h %= 24
view = lambda x: str(x) if x >= 10 else '0' + str(x)
print('%s:%s' % (view(h), view(m)))


(hh, mm) = map(int, input().split(':'))
m = int(input())
mm += m
hh += mm // 60
mm %= 60
hh %= 24
hh = str(hh)
mm = str(mm)
if len(hh) < 2:
	hh = '0' + hh
if len(mm) < 2:
	mm = '0' + mm
print(f'{hh}:{mm}')


from datetime import datetime, timedelta
(h, m) = [int(x) for x in input().split(':')]
D = datetime(1, 1, 1, h, m)
T = timedelta(minutes=int(input()))
D1 = D + T
print('{:0=2d}:{:0=2d}'.format(D1.hour, D1.minute))


(hr, mi) = map(int, input().split(':'))
a = int(input())
hr = (hr + a // 60) % 24
mi = mi + a % 60
if mi >= 60:
	mi %= 60
	hr = (hr + 1) % 24
hour = str(hr)
if len(hour) < 2:
	hour = '0' + hour
minute = str(mi)
if len(minute) < 2:
	minute = '0' + minute
print(hour + ':' + minute)


time = [int(x) for x in input().split(':')]
a = int(input())
hours = a // 60
minutes = a % 60
if time[1] + minutes >= 60:
	time[0] = (time[0] + 1) % 24
time[1] = (time[1] + minutes) % 60
time[0] = (time[0] + hours) % 24
if time[0] < 10:
	x = '0' + str(time[0])
	time[0] = x
if time[1] < 10:
	x = '0' + str(time[1])
	time[1] = x
for x in range(len(time)):
	time[x] = str(time[x])
print(':'.join(time))


(h, m) = map(int, input().split(':'))
v = 60 * h + m + int(input())
print('{:02}:{:02}'.format(v // 60 % 24, v % 60))


(h, m) = map(int, input().split(':'))
a = int(input())
total = h * 60 + m + a
h = total // 60
h_after = h % 24
m_after = total - h * 60
h_after = '0' + str(h_after) if h_after < 10 else str(h_after)
m_after = '0' + str(m_after) if m_after < 10 else str(m_after)
print(h_after + ':' + m_after)


(hour, minute) = list(map(int, input('').split(':')))
a = int(input(''))
hours_passed = a // 60
minutes_left = a % 60
additional_hours = (minute + minutes_left) // 60
final_minutes = (minute + minutes_left) % 60
final_hours = (hour + hours_passed + additional_hours) % 24
h = ''
m = ''
if len(str(final_hours)) == 1:
	h = '0' + str(final_hours)
else:
	h = str(final_hours)
if len(str(final_minutes)) == 1:
	m = '0' + str(final_minutes)
else:
	m = str(final_minutes)
print(h + ':' + m)


def add_minutes(s1, minutes):
	(hours, mins) = map(int, s1.split(':'))
	s = hours * 60 + mins
	s2 = s + minutes
	if divmod(s2 % 1440, 60)[0] < 10 and divmod(s2 % 1440, 60)[1] < 10:
		return '0' + str(divmod(s2 % 1440, 60)[0]) + ':' + '0' + str(divmod(s2 % 1440, 60)[1])
	elif divmod(s2 % 1440, 60)[0] < 10:
		return '0' + str(divmod(s2 % 1440, 60)[0]) + ':' + str(divmod(s2 % 1440, 60)[1])
	elif divmod(s2 % 1440, 60)[1] < 10:
		return str(divmod(s2 % 1440, 60)[0]) + ':' + '0' + str(divmod(s2 % 1440, 60)[1])
	return str(divmod(s2 % 1440, 60)[0]) + ':' + str(divmod(s2 % 1440, 60)[1])
t = input()
m = int(input())
print(add_minutes(t, m))


(h, m) = input().split(':')
h = int(h)
m = int(m)
a = int(input())
finalHour = ''
finalMin = ''
m = m + a
h = h + int(m / 60)
m = int(m % 60)
h = h % 24
if h < 10:
	if h == 0:
		finalHour = '00'
	else:
		finalHour = '0' + str(h)
else:
	finalHour = str(h)
if m < 10:
	if m == 0:
		finalMin = '00'
	else:
		finalMin = '0' + str(m)
else:
	finalMin = str(m)
print(finalHour + ':' + finalMin)


(c, m) = map(int, input().split(':'))
m1 = int(input())
M = c * 60 + m + m1
c = M // 60
if c >= 24:
	c = c % 24
m = M % 60
print(c // 10, c % 10, ':', m // 10, m % 10, sep='')


(hh, mm) = map(int, input().split(':'))
a = int(input()) % (60 * 24)
mm += a
hh += mm // 60
mm %= 60
hh %= 24
print('%0.2d:%0.2d' % (hh, mm))


(hour, minute) = tuple(map(int, input().split(sep=':')))
m = int(input())
a = m // 60
rem = m % 60
hour += a
minute += rem
if minute >= 60:
	hour += 1
	minute -= 60
hour = hour % 24
print('{}:{}'.format(str(hour).zfill(2), str(minute).zfill(2)))


s = input()
a = int(input())
min = int(s[3:])
hr = (a + min) // 60
min = (a + min) % 60
hr = hr + int(s[0:2])
if hr >= 24:
	hr = hr % 24
if hr <= 9:
	hr = '0' + str(hr)
if min <= 9:
	min = '0' + str(min)
print(str(hr) + ':' + str(min))


from math import floor
(h, m) = map(int, input().split(':'))
minute = int(input())
x = h * 60 + m + minute
h2 = floor(x / 60) % 24
m2 = x % 60
ans = ''
if h2 < 10:
	ans += '0' + str(h2)
else:
	ans += str(h2)
ans += ':'
if m2 < 10:
	ans += '0' + str(m2)
else:
	ans += str(m2)
print(ans)


(h, m) = [int(i) for i in input().split(':')]
t = int(input())
h2 = (h * 60 + m + t) % (24 * 60)
print('%02d:%02d' % (h2 // 60, h2 % 60))


(a, b) = map(int, input().split(':'))
d = int(input())
(da, db) = (d // 60, d % 60)
bb = b + db
da += bb // 60
bb = bb % 60
aa = (a + da) % 24
(sa, sb) = (str(aa), str(bb))
if aa < 10:
	sa = '0' + sa
if bb < 10:
	sb = '0' + sb
print(sa + ':' + sb)


t = input().split(':')
a = int(input())
mn = a % 60
hr = a // 60
mn = mn + int(t[1])
hr = hr + mn // 60
mn = mn % 60
hr = hr + int(t[0])
hr = hr % 24
if hr <= 9:
	print(0, hr, ':', sep='', end='')
else:
	print(hr, ':', sep='', end='')
if mn <= 9:
	print(0, mn, sep='')
else:
	print(mn, sep='')


def TheTime(timeInhrMin, toAdd):
	(hr, minutes) = [int(x) for x in timeInhrMin.split(':')]
	timeInMin = hr * 60 + minutes + toAdd
	minutes = f'{timeInMin % 60:02}'
	hr = timeInMin // 60
	hr = hr % 24
	hr = f'{hr:02}'
	print(str(hr) + ':' + str(minutes))
time = input()
toAdd = int(input())
TheTime(time, toAdd)


(a, b) = map(int, input().split(':'))
z = int(input())
k = z // 60
z = z % 60
a = (a + k) % 24
if b + z > 59:
	a = (a + 1) % 24
	b = (b + z) % 60
else:
	b += z
a = str(a)
b = str(b)
if len(a) == 1:
	a = '0' + a
if len(b) == 1:
	b = '0' + b
print(a + ':' + b)


(hr, mn) = map(int, input().split(':'))
delta = int(input())
hr += (mn + delta) // 60
hr = hr % 24
mn = (mn + delta) % 60
hr = str(hr)
mn = str(mn)
if len(mn) == 1:
	mn = '0' + mn
if len(hr) == 1:
	hr = '0' + hr
print(hr + ':' + mn)


s = str(input())
h = s.split(':')[0]
m = s.split(':')[1]
h = int(h)
m = int(m)
t = int(input())
hours = t // 60
if t >= 60:
	t = t - hours * 60
m = m + t
if m >= 60:
	hours = hours + 1
	m = m - 60
h = h + hours
if h > 23:
	h = h % 24
h = str(h)
m = str(m)
if len(h) != 2:
	h = '0' + h
if len(m) != 2:
	m = '0' + m
print(h + ':' + m)


n = [int(i) for i in input().split(':')]
a = int(input())
h = a // 60
n[0] = (n[0] + h) % 24
if (n[1] + a % 60) % 60 == n[1] + a % 60:
	n[1] = n[1] + a % 60
else:
	n[1] = (n[1] + a % 60) % 60
	n[0] = (n[0] + 1) % 24
n[0] = '0' * (2 - len(str(n[0]))) + str(n[0])
n[1] = '0' * (2 - len(str(n[1]))) + str(n[1])
print(n[0], n[1], sep=':')


n = [int(i) for i in input().split(':')]
m = int(input())
(x, r) = divmod(m, 60)
m = n[1] + r
m1 = 0
if m >= 60:
	m1 = 1
m = m % 60
h = (n[0] + x + m1) % 24
print('{:02d}:{:02d}'.format(h, m))


s = input().split(':')
s[0] = int(s[0])
s[1] = int(s[1])
n = int(input())
s[1] += n
if s[1] >= 60:
	s[0] += s[1] // 60
	s[1] = s[1] % 60
if s[0] >= 24:
	s[0] = s[0] % 24
if s[1] <= 9:
	Q = str('0' + str(s[1]))
	if s[0] <= 9:
		R = str('0' + str(s[0]))
		print(R + ':' + Q)
	else:
		print(str(s[0]) + ':' + Q)
elif s[0] <= 9:
	R = str('0' + str(s[0]))
	print(R + ':' + str(s[1]))
else:
	print(str(s[0]) + ':' + str(s[1]))


(hh, mm) = map(int, input().split(':'))
a = int(input())
print('%02d' % ((hh + (mm + a) // 60) % 24) + ':' + '%02d' % ((mm + a) % 60))


(h, m) = map(int, input().split(':'))
n = int(input())
print(str(100 + (h + (m + n) // 60) % 24)[1:] + ':' + str(100 + (m + n) % 60)[1:])


from sys import argv, exit

def rstr():
	return input()

def rint():
	return int(input())

def rints():
	return [int(i) for i in input().split(' ')]

def prnt(*args):
	if '-v' in argv:
		print(*args)
t = rstr()
splt = t.split(':')
th = int(splt[0])
tm = int(splt[1])
mins = rint()
hours = int(mins / 60) % 24
mins = mins % 60
th = (th + hours) % 24
tm = tm + mins
if tm >= 60:
	th += 1
	th = th % 24
	tm = tm % 60
print('{:02d}:{:02d}'.format(int(th), int(tm)))


(a, b) = map(int, input().split(':'))
c = int(input())
k = (a * 60 + b + c) % 1440
h = k // 60
m = k % 60
if h >= 0 and h <= 9:
	print('0' + str(h) + ':', end='')
else:
	print(str(h) + ':', end='')
if m >= 0 and m <= 9:
	print('0' + str(m), end='')
else:
	print(str(m), end='')


import sys
import bisect
from bisect import bisect_left as lb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)

def hnbhai():
	(h, m) = input().split(':')
	h = int(h)
	m = int(m)
	a = sb()
	hh = a // 60
	mm = a % 60
	if m + mm >= 60:
		m = (mm + m) % 60
		hh += 1
	else:
		m = m + mm
	h = (h + hh) % 24
	print('0' * (2 - len(str(h))) + str(h) + ':' + '0' * (2 - len(str(m))) + str(m))
for _ in range(1):
	hnbhai()


def main():
	(a, b) = map(int, input().split(':'))
	c = int(input())
	a += c // 60
	b += c % 60
	if b > 59:
		b %= 60
		a += 1
	aa = str(a % 24)
	if len(aa) < 2:
		aa = '0' + aa
	bb = str(b % 60)
	if len(bb) < 2:
		bb = '0' + bb
	print(aa + ':' + bb)

def __starting_point():
	main()
__starting_point()


s = input().split(':')
n = int(input())
s = int(s[0]) * 60 + int(s[1]) + n
if s >= 24 * 60:
	s %= 24 * 60
hr = str(s // 60).rjust(2, '0')
s %= 60
mi = str(s).rjust(2, '0')
print(f'{hr}:{mi}')


(hh, mm) = str(input()).split(':')
if hh.startswith('0'):
	hh = hh[-1]
if mm.startswith('0'):
	mm = mm[-1]
hh = int(hh)
mm = int(mm)
a = int(input()) % 1440
hh += a // 60
mm += a % 60
if mm >= 60:
	mm -= 60
	hh += 1
if hh >= 24:
	hh -= 24
print('%02d:%02d' % (hh, mm))


def add(time, hour, minute):
	x = hour % 24 if hour > 24 else hour
	if time['hour'] + x > 23:
		time['hour'] = abs(24 - (x + time['hour']))
	else:
		time['hour'] += x
	if time['minute'] + minute > 59:
		time['minute'] = abs(60 - (time['minute'] + minute))
		if time['hour'] + 1 > 23:
			time['hour'] = 0
		else:
			time['hour'] += 1
	else:
		time['minute'] += minute
	return time

def formatHour(time):
	out = ''
	if time['hour'] >= 10:
		out += str(time['hour']) + ':'
	else:
		out += '0' + str(time['hour']) + ':'
	if time['minute'] >= 10:
		out += str(time['minute'])
	else:
		out += '0' + str(time['minute'])
	return out
hour24 = input()
minute = int(input())
(h, m) = map(int, hour24.split(':'))
time = {'hour': h, 'minute': m}
if minute / 60 == int(minute / 60):
	h = int(minute / 60)
	m = 0
else:
	h = int(minute / 60)
	m = minute - int(minute / 60) * 60
add(time, h, m)
print(formatHour(time))


ch = input()
n = int(input())
l = [int(ch[:2]), int(ch[3:])]
m = l[1] + n
h = (l[0] + m // 60) % 24
m = m % 60
if h // 10 == 0:
	print(0, end='')
print(h, end=':')
if m // 10 == 0:
	print(0, end='')
print(m)


s = input()
a = int(input())
(h, m) = s.split(':')
h = int(h)
m = int(m)
z = m + a
m1 = z % 60
z = z - m1
h1 = (h + z // 60) % 24
h1 = str(h1)
if len(h1) == 1:
	h1 = '0' + h1
m1 = str(m1)
if len(m1) == 1:
	m1 = '0' + m1
print(h1 + ':' + m1)


(a, b) = map(int, input().split(':'))
n = int(input())
b += n
a += b // 60
b = b % 60
a %= 24
if b < 10:
	b = '0' + str(b)
else:
	b = str(b)
if a < 10:
	a = '0' + str(a)
else:
	a = str(a)
print(a + ':' + b)


(hh, mm) = map(int, input().split(':'))
a = int(input())
hh += a // 60
mm += a % 60
hh += mm // 60
hh %= 24
mm %= 60
(hh, mm) = (str(hh), str(mm))
if len(hh) == 1:
	hh = '0' + hh
if len(mm) == 1:
	mm = '0' + mm
print(hh + ':' + mm)


(h, m) = map(int, input().split(':'))
a = int(input())
t = (h * 60 + m + a) % (60 * 24)
print('{:02d}:{:02d}'.format(t // 60, t % 60))


(h, m) = [int(x) for x in input().split(':')]
a = int(input())
x = h * 60 + m + a
x = x % (60 * 24)
print(x // 600, x // 60 % 10, ':', x % 60 // 10, x % 60 % 10, sep='')


(a, b) = map(int, input().split(':'))
c = int(input())
x = 60 * a + b + c
x %= 60 * 24
a = x // 60
b = x % 60
a = str(a)
b = str(b)
if len(a) == 1:
	a = '0' + a
if len(b) == 1:
	b = '0' + b
print(a + ':' + b)


(n, m) = input().split(':')
t = int(input())
n = int(n)
m = int(m)
m = m + t % 60
if m // 60:
	n += m // 60
n = (n + t // 60) % 24
m = m % 60
n = str(n)
m = str(m)
if len(n) == 1:
	n = '0' + n
if len(m) == 1:
	m = '0' + m
print(n + ':' + m)


s = input()
h = int(s[0:2])
m = int(s[3:5])
allmin = 60 * h + m
allmin += int(input())
allmin = allmin % (24 * 60)
h = allmin // 60
m = allmin % 60
print('%02d:%02d' % (h, m))


time = input()
more = int(input())
(h, m) = (int(time[:time.index(':')]), int(time[time.index(':') + 1:]))
moreh = more // 60
morem = more % 60
h += moreh
m += morem
if m >= 60:
	h += m // 60
	m = m % 60
if h >= 24:
	h = h % 24
if len(str(h)) < 2:
	h = '0' + str(h)
if len(str(m)) < 2:
	m = '0' + str(m)
print('%s:%s' % (h, m))


(hh, mm) = map(int, input().split(':'))
a = int(input())
m = (mm + a) % 60
h = (mm + a) // 60
h2 = (hh + h) % 24
print('{0:02d}:{1:02d}'.format(h2, m))


from math import sqrt

def main():
	d = [int(v) for v in input().split(':')]
	c = int(input())
	s = d[0] * 60 + d[1] + c
	s1 = str(s // 60 % 24)
	if len(s1) == 1:
		s1 = '0' + s1
	s2 = str(s % 60)
	if len(s2) == 1:
		s2 = '0' + s2
	print(':'.join([s1, s2]))
main()


X = list(map(int, input().split(':')))
Min = X[0] * 60 + X[1] + int(input())
Hour = str(Min // 60 % 24)
Minute = str(Min % 60)
print(Hour if len(Hour) == 2 else '0' + Hour, end=':')
print(Minute if len(Minute) == 2 else '0' + Minute)


time = input()
minpast = int(input())
arr = time.split(':')
hrs = int(arr[0])
mins = int(arr[1])
mins_to_add = mins + minpast
hrs_to_add = mins_to_add // 60
final_mins = mins_to_add % 60
final_hrs = hrs + hrs_to_add
if final_hrs > 23:
	final_hrs = final_hrs % 24
print(str(f'{final_hrs:02d}') + ':' + str(f'{final_mins:02d}'))


(h, m) = map(int, input().split(':'))
a = int(input())
for i in range(a):
	m += 1
	if m == 60:
		m = 0
		h += 1
	if h == 24:
		h = 0
hh = '0' + str(h) if h < 10 else str(h)
mm = '0' + str(m) if m < 10 else str(m)
print(hh + ':' + mm)


(h, m) = [int(i) for i in input().split(':')]
n = int(input())
m = m + n
h = h + m // 60
h = h % 24
m = m % 60
if h < 10:
	h = '0' + str(h)
if m < 10:
	m = '0' + str(m)
h = str(h)
m = str(m)
print(h + ':' + m)


(h, m) = map(int, input().split(':'))
d = int(input())
m += d
h += m // 60
print(f'{h % 24:02}:{m % 60:02}')


import sys
import datetime

def main():
	(h, m) = map(int, input().split(':'))
	addm = int(input())
	d = datetime.datetime(1970, 1, 1, h, m)
	d += datetime.timedelta(1970, 1, 1, 0, addm)
	hh = str(d.hour)
	mm = str(d.minute)
	if len(hh) == 1:
		hh = '0' + hh
	if len(mm) == 1:
		mm = '0' + mm
	print(hh, mm, sep=':')
main()


t = input()
(h, m) = (int(t.split(':')[0]), int(t.split(':')[1]))
a = int(input())
time = h * 60 + m + a
mm = time % 60
hh = (time - mm) / 60 % 24
print('%02d:%02d' % (hh, mm))


(h, m) = map(int, input().split(':'))
ad = int(input())
nwm = (ad + m) % 60
nwh = (h + (ad + m) // 60) % 24
print('%02d:%02d' % (nwh, nwm))


def inc(time):
	f = time[:2]
	m = time[2]
	s = time[3:]
	if s == '59':
		s = '00'
		if f == '23':
			f = '00'
			return f + m + s
		else:
			f = str(int(f) + 1)
			if len(f) == 1:
				f = '0' + f
			return f + m + s
	else:
		s = str(int(s) + 1)
		if len(s) == 1:
			s = '0' + s
		return f + m + s
time = input()
a = int(input())
for i in range(a):
	time = inc(time)
print(time)


(h, m) = map(int, input().split(':'))
a = int(input())
h = (h + int((a + m) / 60)) % 24
m = (m + a) % 60
m = str(m).zfill(2)
h = str(h).zfill(2)
print(f'{h}:{m}')


(a, b) = input().split(':')
a = int(a)
b = int(b)
c = input()
c = int(c)
while c > 0:
	c -= 1
	b += 1
	if b == 60:
		b = 0
		a += 1
	if a == 24:
		a = 0
s = str(a).rjust(2, '0') + ':' + str(b).rjust(2, '0')
print(s)


b = list(map(int, input().split(':')))
n = int(input())
s = 0
o = 0
c = b[1]
g = n
if n == 0:
	if b[0] < 10:
		if b[1] < 10:
			print('0' + str(b[0]) + ':' + '0' + str(b[1]))
		else:
			print('0' + str(b[0]) + ':' + str(b[1]))
	elif b[1] < 10:
		print(str(b[0]) + ':' + '0' + str(b[1]))
	else:
		print(str(b[0]) + ':' + str(b[1]))
if n % 60 == 0 and g > 0:
	b[0] += n // 60
elif n + b[1] >= 60:
	s = 60 - b[1]
	g = n
	n = n - s
	o = n // 60
	b[0] += 1 + o
	b[1] = n - 60 * o
elif n + b[1] < 60:
	b[1] = b[1] + n
if b[0] >= 24 and g > 0:
	a = b[0] // 24
	b[0] = b[0] - 24 * a
	if b[0] < 10:
		if b[1] < 10:
			print('0' + str(b[0]) + ':' + '0' + str(b[1]))
		else:
			print('0' + str(b[0]) + ':' + str(b[1]))
	elif b[1] < 10:
		print(str(b[0]) + ':' + '0' + str(b[1]))
	else:
		print(str(b[0]) + ':' + str(b[1]))
elif g > 0:
	if b[0] < 10:
		if b[1] < 10:
			print('0' + str(b[0]) + ':' + '0' + str(b[1]))
		else:
			print('0' + str(b[0]) + ':' + str(b[1]))
	elif g > 0:
		if b[1] < 10:
			print(str(b[0]) + ':' + '0' + str(b[1]))
		else:
			print(str(b[0]) + ':' + str(b[1]))


def f():
	time = [int(x) for x in input().split(':')]
	minutes_passed = int(input())
	time[1] += minutes_passed
	while time[1] >= 60:
		time[1] -= 60
		time[0] += 1
	while time[0] >= 24:
		time[0] -= 24
	hour = str(time[0]) if time[0] >= 10 else '0' + str(time[0])
	minutes = str(time[1]) if time[1] >= 10 else '0' + str(time[1])
	print(f'{hour}:{minutes}')
f()


[h, m] = [int(x) for x in input().split(':')]
a = int(input())
newm = (m + a) % 60
newh = (h + (m + a) // 60) % 24
ans = ''
if newm < 10 and newh < 10:
	ans = '0{}:0{}'.format(newh, newm)
elif newm < 10:
	ans = '{}:0{}'.format(newh, newm)
elif newh < 10:
	ans = '0{}:{}'.format(newh, newm)
else:
	ans = '{}:{}'.format(newh, newm)
print(ans)


(h, m) = map(int, input().split(':'))
a = int(input())
mm = h * 60 + m + a
h = mm // 60 % 24
m = mm % 60
s = ('0' if h < 10 else '') + str(h) + ':' + ('0' if m < 10 else '') + str(m)
print(s)


(a, b) = input().split(':')
t = int(input())
a = int(a)
b = int(b)
a = (a + int((b + t) / 60)) % 24
b = (b + t) % 60
if a < 10:
	print('0', end='')
print(a, end='')
print(':', end='')
if b < 10:
	print('0', end='')
print(b, end='')


s = input()
d = int(input())
(a, b) = s.split(':')
a = int(a)
b = int(b)
a += (b + d) // 60
a %= 24
b += d
b %= 60
if a < 10:
	a = '0' + str(a)
else:
	a = str(a)
if b < 10:
	b = '0' + str(b)
else:
	b = str(b)
ans = a + ':' + b
print(ans)


t = input().split(':')
ar = []
nm = 0
for i in t:
	ar.append(int(i))
c = int(input())
m = ar[1] + c
if m > 59:
	nm = m % 60
	ar[0] += m // 60
	ar[0] = ar[0] % 24
	ar[1] = nm
	if len(str(nm)) < 2:
		ar[1] = '0' + str(nm)
elif m < 10:
	ar[1] = '0' + str(m)
elif m >= 10:
	ar[1] = m
if ar[0] < 10:
	ar[0] = '0' + str(ar[0])
if ar[0] == 24:
	ar[0] = str(0) * 2
s = ''
s = ':'.join([str(i) for i in ar])
print(s)


(n, m) = map(int, input().split(':'))
M = int(input())
a = (n * 60 + m + M) // 60 % 24
b = (n * 60 + m + M) % 60

def t(s):
	if int(s) < 10:
		return '0' + s
	else:
		return s
s = t(str(a)) + ':' + t(str(b))
print(s)


s = input()
a = input()
a = int(a)
hh = int(s[0:2])
mm = int(s[3:5])
a = a % 1440
hh = hh + int(a / 60)
mm = mm + a % 60
if mm >= 60:
	hh = hh + 1
	mm = mm - 60
if hh >= 24:
	hh = hh - 24
if hh < 10:
	hh = str(hh)
	hh = '0' + hh
if mm < 10:
	mm = str(mm)
	mm = '0' + mm
print(hh, ':', mm, sep='')


s = str(input())
n = int(input())
h = int(s[0:2])
m = int(s[3:5])
f = h * 60 + m + n
x = f // 60
y = f % 60
x = x % 24
if len(str(x)) == 2:
	print(str(x) + ':', end='')
	if len(str(y)) == 2:
		print(str(y))
	else:
		print('0' + str(y))
else:
	print('0' + str(x) + ':', end='')
	if len(str(y)) == 2:
		print(str(y))
	else:
		print('0' + str(y))


s = input()
a = int(input())
x = a // 60
y = a % 60
h = int(s[:2])
m = int(s[3:])
if m + y < 60:
	if m + y >= 10:
		if (h + x) % 24 <= 9:
			print('0{}:{}'.format((h + x) % 24, m + y))
		else:
			print('{}:{}'.format((h + x) % 24, m + y))
	elif (h + x) % 24 <= 9:
		print('0{}:0{}'.format((h + x) % 24, m + y))
	else:
		print('{}:0{}'.format((h + x) % 24, m + y))
elif m + y - 60 >= 10:
	if (h + x + 1) % 24 <= 9:
		print('0{}:{}'.format((h + x + 1) % 24, m + y - 60))
	else:
		print('{}:{}'.format((h + x + 1) % 24, m + y - 60))
elif (h + x + 1) % 24 <= 9:
	print('0{}:0{}'.format((h + x + 1) % 24, m + y - 60))
else:
	print('{}:0{}'.format((h + x + 1) % 24, m + y - 60))


s = input()
n = int(input())
hour = int(s[:s.find(':')])
minute = int(s[s.find(':') + 1:])
if 60 - minute > n:
	minute += n
elif 60 - minute == n:
	minute = 0
	hour += 1
else:
	hour += 1
	minute = abs(60 - n - minute)
while minute >= 60:
	hour += 1
	minute = abs(60 - minute)
while hour > 24:
	hour = abs(24 - hour)
if hour == 24:
	hour = 0
if len(str(hour)) == 1:
	hour = '0' + str(hour)
if len(str(minute)) == 1:
	minute = '0' + str(minute)
print(str(hour) + ':' + str(minute))


time = input()
a = int(input())
h = int(time[:2])
m = int(time[3:])
a = a % 1440
dh = a // 60
dm = a % 60
m += dm
carry = m // 60
m %= 60
h = (h + dh + carry) % 24
print('{:02}:{:02}'.format(h, m))


(a, b) = input().split(':')
(a, b) = (int(a), int(b))
c = int(input())
(e, f, c, d) = (0, 0, c // 60, c % 60)
(b, e) = ((b + d) % 60, (b + d) // 60)
a = (a + c + e) % 24
print('0' * (a < 10) + str(a) + ':' + '0' * (b < 10) + str(b))


(h, m) = [int(x) for x in input().split(':')]
d = int(input())
m = m + d
while m >= 60:
	m = m - 60
	h = h + 1
while h >= 24:
	h = h - 24
print('%02d:%02d' % (h, m))


n = input().split(':')
h = int(n[0])
m = int(n[1])
task_time = int(input())
m += task_time
h += m // 60
m %= 60
h %= 24
print('0' * int(len(str(h)) == 1) + str(h) + ':' + '0' * int(len(str(m)) == 1) + str(m))


(hh, mm) = map(int, input().split(':'))
a = int(input())
h = int(a / 60)
m = a % 60
mm += m
if mm > 59:
	mm = mm % 60
	h += 1
hh += h
if hh > 23:
	hh = hh % 24
print(f'{hh:02}:{mm:02}')


(x, y) = map(int, input().split(':'))
z = int(input())
s = x * 60 + y + z
xx = s // 60
xx = str(xx % 24)
r = str(s % 60)
if len(xx) == 1:
	xx = '0' + xx
if len(r) == 1:
	r = '0' + r
print(xx + ':' + r)


m = input().split(':')
a = int(input())
m[0] = int(m[0])
m[1] = int(m[1])
m[1] = m[1] + a
m[0] = m[0] + m[1] // 60
m[0] = m[0] % 24
m[1] = m[1] % 60
m[0] = str(m[0])
m[1] = str(m[1])
if len(m[0]) < 2:
	m[0] = '0' + m[0]
if len(m[1]) < 2:
	m[1] = '0' + m[1]
ans = m[0] + ':' + m[1]
print(ans)


(h, m) = map(int, input().split(':'))
a = int(input()) % 1440
(ah, am) = divmod(a, 60)
if m + am > 59:
	ah += 1
m = (m + am) % 60
h = (h + ah) % 24
hs = str(h)
if len(hs) == 1:
	hs = '0' + hs
ms = str(m)
if len(ms) == 1:
	ms = '0' + ms
print(hs + ':' + ms)


3
(hh, mm) = [int(i) for i in input().split(':')]
a = int(input())
mm += a
hh += mm // 60
mm %= 60
hh %= 24
print(str(hh).zfill(2) + ':' + str(mm).zfill(2))


(h, m) = list(map(int, input().split(':')))
a = int(input())
m += a % 60
if m > 59:
	m -= 60
	h += 1
ha = a // 60
h += ha
h %= 24
ans = ''
if len(str(h)) == 1:
	ans += '0' + str(h)
else:
	ans += str(h)
ans += ':'
if len(str(m)) == 1:
	ans += '0' + str(m)
else:
	ans += str(m)
print(ans)


(h, m) = list(map(int, input().split(':')))
a = int(input())
t = h * 60 + m + a
t %= 24 * 60
h2 = t // 60
m2 = t % 60
print(str(h2 // 10) + str(h2 % 10) + ':' + str(m2 // 10) + str(m2 % 10))


(hh, mm) = map(int, input().split(':'))
x = int(input())
mm += hh * 60
mm += x
mm %= 1440
hh = mm // 60
if hh < 10:
	hh = '0' + str(hh)
mm = mm % 60
if mm < 10:
	mm = '0' + str(mm)
ans = [hh, ':', mm]
print(*ans, sep='')


def numdig(n):
	if n == 0:
		return 1
	else:
		ans = 0
		while n > 0:
			ans += 1
			n = n // 10
		return ans
s1 = str(input())
h = int(s1[0:2])
m = int(s1[3:])
n = int(input())
m1 = (m + n) % 60
if numdig(m1) == 1:
	m2 = '0' + str(m1)
else:
	m2 = str(m1)
if m + n >= 60:
	h1 = (h + (m + n) // 60) % 24
else:
	h1 = h
if numdig(h1) == 1:
	h2 = '0' + str(h1)
else:
	h2 = str(h1)
print(h2 + ':' + m2)


hm = list(map(int, input().split(':')))
a = int(input())
hm[0] = str(((hm[1] + a) // 60 + hm[0]) % 24)
hm[1] = str((hm[1] + a) % 60)
if len(hm[0]) == 1:
	hm[0] = '0' + hm[0]
if len(hm[1]) == 1:
	hm[1] = '0' + hm[1]
print(hm[0], hm[1], sep=':')


__author__ = 'runekri3'
(clock_hours, clock_minutes) = list(map(int, input().split(':')))
move_minutes = int(input())
minutes = clock_hours * 60 + clock_minutes + move_minutes
hours = minutes // 60
minutes -= hours * 60
(hours, minutes) = (str(hours % 24), str(minutes))
hours = '0' * (2 - len(hours)) + hours
minutes = '0' * (2 - len(minutes)) + minutes
print(hours, minutes, sep=':')


def plus(s, a, b):
	if s == '23:59':
		return ['00:00', '00', '00']
	elif b == '59':
		b = '00'
		a = int(a)
		a += 1
		a = a % 24
		a = str(a)
		if len(a) == 1:
			a = '0' + a
		if len(b) == 1:
			b = '0' + b
		s = a + ':' + b
		return [s, a, b]
	else:
		b = int(b)
		b += 1
		b = str(b)
		if len(a) == 1:
			a = '0' + a
		if len(b) == 1:
			b = '0' + b
		s = a + ':' + b
		return [s, a, b]
s = input()
k = int(input())
if k == 0:
	print(s)
else:
	s = s.split(':')
	a = s[0]
	b = s[1]
	for i in range(k):
		f = plus(s, a, b)
		s = f[0]
		a = f[1]
		b = f[2]
	print(s)


s = str(input())
a = int(input())
h = int(s[0:2])
m = int(s[3:])
minu = (60 * h + m + a) % 1440
h = minu // 60
m = minu - h * 60
if h < 10:
	h = '0' + str(h)
else:
	h = str(h)
if m < 10:
	m = '0' + str(m)
else:
	m = str(m)
print(h + ':' + m)


(hr, mn) = map(int, input().split(':'))
has = (hr * 60 + mn + int(input())) % (24 * 60)
print(str(has // 60).rjust(2, '0') + ':' + str(has % 60).rjust(2, '0'))


from collections import deque
from math import log, sqrt, ceil

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(':'))

def li():
	return list(mi())
(h, m) = mi()
y = ii()
m += y % 60
h += y // 60
h += m // 60
m %= 60
h %= 24
if h < 10:
	h = '0' + str(h)
if m < 10:
	m = '0' + str(m)
h = str(h)
m = str(m)
print(h + ':' + m)


import math

def solve():
	time = input()
	(h, m) = [int(item) for item in time.split(':')]
	minutes = int(input())
	total_min = m + minutes
	hours = int(total_min / 60)
	min_rem = str(total_min % 60)
	total_hour = h + hours
	hour_rem = str(total_hour % 24)
	if len(hour_rem) == 1:
		hour_rem = '0' + hour_rem
	if len(min_rem) == 1:
		min_rem = '0' + min_rem
	print(str(hour_rem) + ':' + str(min_rem))
solve()


(h, m) = map(int, input().split(':'))
x = int(input())
(ho, mi) = divmod(x, 60)
h += ho
m += mi
(a, b) = divmod(m, 60)
h += a
m = b
if h >= 24:
	h %= 24
if len(str(h)) == 1:
	h = '0' + str(h)
if len(str(m)) == 1:
	m = '0' + str(m)
print(str(h) + ':' + str(m))


(h, m) = [int(a) for a in input().strip().split(':')]
add = int(input().strip())
hadd = int(add / 60)
madd = add % 60
nm = (m + madd) % 60
hadd += int((m + madd) / 60)
nh = (h + hadd) % 24
sh = str(nh)
if len(sh) < 2:
	sh = '0' + sh
sm = str(nm)
if len(sm) < 2:
	sm = '0' + sm
print(sh + ':' + sm)


n = input()
a = int(input())
(HH, MM) = (int(n[0:2]), int(n[3:6]))
(s, q) = (a // 60, a % 60)
(p, r) = ((MM + q) // 60, (MM + q) % 60)
m = s + p
while m >= 0:
	if HH == 24:
		HH = 0
		if m == 0:
			break
	else:
		if m == 0:
			break
		HH += 1
		m -= 1
if HH < 10:
	HH = f'0{HH}'
if r < 10:
	r = f'0{r}'
print(f'{HH}:{r}')


(h, m) = map(int, input().split(':'))
a = int(input())
t = (h * 60 + m + a) % (24 * 60)
nt = str(t // 60).zfill(2)
nm = str(t - t // 60 * 60).zfill(2)
print(nt + ':' + nm)


import math
date = input()
(hours, minutes) = date.split(':')
hours = int(hours)
minutes = int(minutes)
minutes_to_add = int(input())
new_minutes = minutes_to_add % 60
new_hours = math.floor(minutes_to_add / 60)
minutes = minutes + new_minutes
extra_hours = math.floor(minutes / 60)
minutes = minutes % 60
hours = hours + new_hours + extra_hours
hours = hours % 24
final_string = ''
if hours < 10:
	final_string = '0' + str(hours) + ':'
else:
	final_string = str(hours) + ':'
if minutes < 10:
	final_string = final_string + '0' + str(minutes)
else:
	final_string = final_string + str(minutes)
print(final_string)


(h, m) = map(int, input().split(':'))
a = int(input())
res_m = m + a
res_h = h + res_m // 60
if res_h % 24 < 10:
	print(0, res_h % 24, sep='', end=':')
else:
	print(res_h % 24, end=':')
if res_m % 60 < 10:
	print(0, res_m % 60, sep='')
else:
	print(res_m % 60)


def to_format(h):
	if h < 10:
		return '0' + str(h)
	else:
		return str(h)
time = input()
time = time.split(':')
add = int(input())
minutes = int(time[0]) * 60 + int(time[1])
minutes += add
hours = minutes // 60 % 24
minutes %= 60
print(to_format(hours) + ':' + to_format(minutes))


(h, m) = map(int, input().split(':'))
m += int(input())
h += m // 60
m %= 60
h %= 24
print('%02d:%02d' % (h, m))


import re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10 ** 7)
dX = [-1, 1, 0, 0, -1, 1, -1, 1]
dY = [0, 0, -1, 1, 1, -1, -1, 1]
RI = lambda x=' ': list(map(int, input().split(x)))
RS = lambda x=' ': input().rstrip().split(x)
mod = int(1000000000.0 + 7)
eps = 1e-06
(h, m) = RI(':')
mm = RI()[0]
m += mm
hh = m // 60
mm %= 60
m %= 60
h = (hh + h) % 24
print('%02d:%02d' % (h, m))


time = input()
deltatime = input()
deltatime = int(deltatime)
i = 0
while time[i] != ':':
	i += 1
hours = int(time[0:i])
minutes = int(time[i + 1:])
all_minutes = hours * 60 + minutes + deltatime
all_minutes = all_minutes % (60 * 24)
new_hours = int(all_minutes / 60)
new_minutes = int(all_minutes % 60)
print('%(hours)02d:%(minutes)02d' % {'hours': new_hours, 'minutes': new_minutes})


def f(a):
	if len(str(a)) == 1:
		return '0' + str(a)
	return a
(hh, mm) = map(int, input().split(':'))
aa = hh * 60 + mm
aa += int(input())
aa %= 24 * 60
mm = aa % 60
aa //= 60
print(f(aa), ':', f(mm), sep='')


(h, m) = list(map(int, input().split(':')))
a = int(input())
h += (m + a) // 60
m = (m + a) % 60
h %= 24
ms = ''
hs = ''
if h < 10:
	hs += '0'
if m < 10:
	ms += '0'
hs += str(h)
ms += str(m)
print('%s:%s' % (hs, ms))


(h, m) = map(int, input().split(':'))
minutes = int(input())
m += minutes
h += m // 60
m %= 60
h %= 24
print((2 - len(str(h))) * '0', h, ':', (2 - len(str(m))) * '0', m, sep='')


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber

def z(n):
	if n < 10:
		return '0' + str(n)
	else:
		return str(n)
(h, m) = map(int, input().split(':'))
t = ii()
h = (h + (t + m) // 60) % 24
m = (t + m) % 60
print('{0}:{1}'.format(z(h), z(m)))


def main():
	(h, m) = map(int, input().split(':'))
	(h, m) = divmod(h * 60 + m + int(input()), 60)
	print('{:0>2d}:{:0>2d}'.format(h % 24, m))
main()


def time_after(hours, minutes, add_minutes):
	minutes += add_minutes
	(add_hours, minutes) = divmod(minutes, 60)
	hours += add_hours
	hours %= 24
	return (hours, minutes)

def main():
	(hours, minutes) = [int(n) for n in input().split(':')]
	add_minutes = int(input())
	print('{:02}:{:02}'.format(*time_after(hours, minutes, add_minutes)))
main()


import datetime
import time
t = input()
M = input()
(h, m) = list(map(int, t.split(':')))
(H, M) = divmod(int(M), 60)
a = datetime.datetime(100, 1, 1, h, m, 0)
b = a + datetime.timedelta(0, 0, 0, 0, M, H, 0)
print(b.strftime('%H:%M'))


(h, m) = map(int, input().split(':'))
m += int(input())
h = (h + m // 60) % 24
m = m % 60
f = lambda x: '0' * (not x // 10) + str(x)
print(f(h) + ':' + f(m))


(h, m) = map(int, input().split(':'))
a = int(input())
d = h * 60 + m + a
h = d // 60 % 24
m = d % 60
print(h // 10, h % 10, ':', m // 10, m % 10, sep='')


def __starting_point():
	(hh, mm) = map(int, input().split(sep=':'))
	a = int(input())
	hh += a // 60
	mm += a % 60
	hh += mm // 60
	mm = mm % 60
	hh = hh % 24
	strhh = '0' * (2 - len(str(hh))) + str(hh)
	strmm = '0' * (2 - len(str(mm))) + str(mm)
	print(strhh, ':', strmm, sep='')
__starting_point()


import queue
import math
import io

def bfs(start, graph):
	q = queue.Queue()
	q.put(start)
	used = [False] * (len(graph) + 1)
	d = [0] * (len(graph) + 1)
	p = [0] * (len(graph) + 1)
	p[start] = -1
	used[start] = True
	while not q.empty():
		v = q.get()
		for sh in graph[v]:
			if not used[sh]:
				used[sh] = True
				q.put(sh)
				d[sh] = d[v] + 1
				p[sh] = v
	return [used, d, p]
[h, m] = [int(x) for x in input().split(':')]
mi = int(input())
t = h * 60 + m
tn = (t + mi) % (24 * 60)
nh = tn // 60
nm = tn - nh * 60
res_h = str(nh)
res_m = str(nm)
if len(res_h) == 1:
	res_h = '0' + res_h
if len(res_m) == 1:
	res_m = '0' + res_m
print(res_h + ':' + res_m)


sLine = input()
sSplit = sLine.split(sep=':')
nHour = int(sSplit[0])
nMinute = int(sSplit[1])
nPass = int(input())
nPass = nPass % (60 * 24)
nMinute += nPass
if nMinute >= 60:
	x = nMinute // 60
	nMinute -= 60 * x
	nHour += x
if nHour >= 24:
	nHour %= 24
print('{0:02d}:{1:02d}'.format(nHour, nMinute))


t = input()
c = int(input())
(a, b) = (int(t[:2]), int(t[3:]))
(m, n) = divmod(b + c, 60)
(a, b) = ((a + m) % 24, n)
if len(str(a)) == 1:
	a = '0' + str(a)
if len(str(b)) == 1:
	b = '0' + str(b)
print(str(a) + ':' + str(b))


(hr, mi) = input().split(':')
t = int(input())
min = int(hr) * 60 + int(mi)
min += t
newhr = int(min / 60)
newmin = int(min % 60)
if newhr >= 24:
	newhr = newhr - 24 * int(newhr // 24)
anshr = ''
ansmin = ''
if newhr < 10:
	anshr = '0' + str(newhr)
else:
	anshr = str(newhr)
if newmin < 10:
	ansmin = '0' + str(newmin)
else:
	ansmin = str(newmin)
print(anshr + ':' + ansmin)


ip = str(input())
h = int(ip[0] + ip[1])
m = int(ip[3] + ip[4])
k = h * 60 + m
n = int(input())
k += n
h1 = k // 60 % 24
m1 = k % 60
if h1 < 10:
	h1 = '0' + str(h1)
if m1 < 10:
	m1 = '0' + str(m1)
print(h1, end=':')
print(m1)


st = input()
l = st.split(':')
x = eval(input())
sum = x + int(l[1])
h = sum // 60
l[1] = sum % 60
l[0] = int(l[0])
l[0] += int(h)
ans = ':'
if len(str(l[1])) < 2:
	ans += '0'
	ans += str(l[1])
else:
	ans += str(l[1])
if len(str(l[0] % 24)) >= 2:
	ans = str(l[0] % 24) + ans
else:
	ans = '0' + str(l[0] % 24) + ans
print(ans)


def to_unix(a):
	return int(a.split(':')[0]) * 60 + int(a.split(':')[1])

def to_norm(a):
	a = int(a) % (24 * 60)
	b = a // 60
	c = a % 60
	ans = ''
	if len(str(b)) == 1:
		ans += '0' + str(b)
	else:
		ans += str(b)
	ans += ':'
	if len(str(c)) == 1:
		ans += '0' + str(c)
	else:
		ans += str(c)
	return ans
print(to_norm(to_unix(input()) + int(input())))


t0 = input()
t1 = int(input())
hh = int(t0[0:2])
mm = int(t0[3:5])
x = t1 % 60
y = int(t1 / 1440)
z = int(t1 / 60)
th = z - 24 * y
if t1 >= 60:
	tm = x
else:
	tm = t1
q = tm + mm
t = int(q / 60)
q = q % 60
p = hh + th
if t + p > 23:
	p = 24 - p - t
	if p < 0:
		p = -p
else:
	p = p + t
if p < 10 and q < 10:
	print(f'0{p}:0{q}')
elif p < 10 and q >= 10:
	print(f'0{p}:{q}')
elif p >= 10 and q < 10:
	print(f'{p}:0{q}')
else:
	print(f'{p}:{q}')


(hh, mm) = map(int, input().split(':'))
mm_aj = int(input())
hh = hh + (mm + mm_aj) // 60
mm = (mm + mm_aj) % 60
if hh >= 24:
	hh = hh % 24
if hh >= 10:
	if mm >= 10:
		print(str(hh) + ':' + str(mm))
	else:
		print(str(hh) + ':0' + str(mm))
elif mm >= 10:
	print('0' + str(hh) + ':' + str(mm))
else:
	print('0' + str(hh) + ':0' + str(mm))


a = input()
(hh, mm) = a.split(':')
mins = int(input())
hh = int(hh)
mm = int(mm)
hh += mins // 60
mm += mins - mins // 60 * 60
if mm >= 60:
	b = mm
	mm -= mm // 60 * 60
	hh += b // 60
if hh >= 24:
	hh -= hh // 24 * 24
if hh < 10:
	h = '0' + str(hh)
else:
	h = hh
if mm < 10:
	m = '0' + str(mm)
else:
	m = mm
print('{}:{}'.format(h, m))


s = input()
a = int(s[:2])
b = int(s[-2:])
n = int(input())
if n == 0:
	print(s)
else:
	b = b + n
	x = b // 60
	b = b % 60
	a = (a + x) % 24
	if a >= 24:
		a -= 24
	print(str(a).zfill(2) + ':' + str(b).zfill(2))


(h, m) = map(int, input().strip().split(':'))
a = int(input().strip())
for _ in range(a):
	m += 1
	if m == 60:
		h += 1
		m = 0
	if h == 24:
		h = 0
print(str(h).zfill(2) + ':' + str(m).zfill(2))


s = input()
a = int(input())
(hh, mm) = (int(s[:2]), int(s[3:]))
rm = (hh * 60 + mm + a) % 60
hm = int((hh * 60 + mm + a - rm) / 60) % 24
if hm < 10 and rm < 10:
	print('0', hm, ':', '0', rm, sep='')
elif hm >= 10 and rm < 10:
	print(hm, ':', '0', rm, sep='')
elif hm < 10 and rm >= 10:
	print('0', hm, ':', rm, sep='')
elif hm >= 10 and rm >= 10:
	print(hm, ':', rm, sep='')


Now = input().split(':')
Add = int(input())
Now = [int(item) for item in Now]
Total = Now[0] * 60 + Now[1] + Add
Hour = int(Total / 60)
Minute = str(Total - Hour * 60)
Hour = str(Hour % 24)
print('{0}:{1}'.format(Hour.zfill(2), Minute.zfill(2)))


import fileinput
num_args = 2
for i in range(num_args):
	if i == 0:
		(h, m) = input().split(':')
	else:
		a = int(input())
temp_h = 0
temp_m = 0
temp_d = 0
temp_m = a + int(m)
if temp_m > 59:
	temp_h = temp_m // 60
	temp_m -= 60 * temp_h
if temp_h + int(h) > 23:
	temp_d = (temp_h + int(h)) // 24
	temp_h = temp_h + int(h) - temp_d * 24
else:
	temp_h += int(h)
if temp_h < 10:
	if temp_m < 10:
		final = '0' + str(temp_h) + ':0' + str(temp_m)
	else:
		final = '0' + str(temp_h) + ':' + str(temp_m)
elif temp_m < 10:
	final = str(temp_h) + ':0' + str(temp_m)
else:
	final = str(temp_h) + ':' + str(temp_m)
print(final)


from datetime import time

def main(args):
	(hh, mm) = list(map(int, input().split(':')))
	a = int(input())
	mm += a
	hh += mm // 60
	mm %= 60
	hh %= 24
	t0 = time(hh, mm)
	print(t0.isoformat('minutes'))
	return 0
import sys
sys.exit(main(sys.argv))


a = input()
h = int(a[0:2])
m = int(a[3:5])
n = int(input())
per = (m + n) // 60
m = (m + n) % 60
h = (h + per) % 24
if h < 10:
	print('0' + str(h) + ':', end='')
else:
	print(str(h) + ':', end='')
if m < 10:
	print('0' + str(m))
else:
	print(str(m))


time = input()
d = time.split(':')
h = int(d[0])
m = int(d[1])
a = int(input())
new = h * 60 + m + a
if new >= 1440:
	new = new - 1440 * (new // 1440)
h1 = new // 60
m1 = new % 60
ch1 = str(h1)
ch2 = str(m1)
if h1 < 10:
	ch1 = '0' + ch1
if m1 < 10:
	ch2 = '0' + ch2
ch = ch1 + ':' + ch2
print(ch)


(hh, mm) = input().split(':')
a = int(input())
m = int(hh) * 60 + int(mm) + a
m = m % 1440
(hh, mm) = (m // 60, m % 60)
if hh < 10:
	hh = '0' + str(hh)
if mm < 10:
	mm = '0' + str(mm)
print('{}:{}'.format(hh, mm))


t = input()
a = int(input())
f1 = t.find(':')
h = t[:f1]
m = t[f1 + 1:]
h = int(h)
m = int(m)
r1 = (a + m + h * 60) % (24 * 60)
print('%02d:%02d' % (r1 / 60, r1 % 60))


n = input()
c = int(input())
(a, b) = (int(n[:2]), int(n[3:]))
(x, y) = divmod(b + c, 60)
(a, b) = ((a + x) % 24, y)
if len(str(a)) == 1:
	a = '0' + str(a)
if len(str(b)) == 1:
	b = '0' + str(b)
print(str(a) + ':' + str(b))


(h, m) = map(int, input().split(':'))
a = int(input())
(q1, r1) = divmod(a, 60)
m += r1
(q2, m) = divmod(m, 60)
h += q1 + q2
h %= 24
h = str(h)
m = str(m)
ans = h.zfill(2) + ':' + m.zfill(2)
print(ans)


(h, m) = map(int, input().split(':'))
ad = int(input())
ad = ad + m + h * 60
ad = ad % (24 * 60)
h = ad // 60
m = ad % 60
if h == 24:
	h = 0
print(f'{h:02d}:{m:02d}')


from datetime import datetime, timedelta
time = input()
hour = int(time[0:2])
mins = int(time[3:5])
add = int(input())
op = datetime(2021, 5, 18, hour, mins) + timedelta(minutes=add)
print(op.strftime('%H:%M'))


(hh, mm) = map(int, input().split(':'))
mm += int(input())
while mm >= 60:
	mm -= 60
	hh += 1
	if hh == 24:
		hh = 0
print('{:02d}'.format(hh) + ':' + '{:02d}'.format(mm))


(h, m) = map(int, input().split(':'))
a = int(input())
if a + m >= 60:
	h += (a + m) // 60
	m = (a + m) % 60
else:
	m += a
if h >= 24:
	h = h % 24
h = str(h)
m = str(m)
if len(h) == 1:
	h = '0' + h
if len(m) == 1:
	m = '0' + m
print(':'.join([h, m]))


s = input()
n = int(input())
h = int(s[0:2])
m = int(s[3:])
h += (m + n) // 60
h %= 24
m = (m + n) % 60
s = ''
if len(str(h)) < 2:
	s += '0'
s += str(h) + ':'
if len(str(m)) < 2:
	s += '0'
s += str(m)
print(s)


s = input()
n = int(input())
h = n // 60
min = n % 60
a = 0
if (int(s[3:]) + min) // 60:
	a = (int(s[3:]) + min) // 60
min = str((int(s[3:]) + min) % 60)
if len(min) == 1:
	min = '0' + min
h = str((int(s[0:2]) + h + a) % 24)
if len(h) == 1:
	h = '0' + h
print(h + ':' + min)


time = input()
seconds = int(input())
hours = int(time.split(':')[0])
mins = int(time.split(':')[1])
if seconds < 60:
	mins = mins + seconds
	if mins >= 60:
		mins = mins - 60
		hours += 1
		if hours >= 24:
			hours = hours - 24
else:
	mins = mins + seconds % 60
	if mins >= 60:
		mins = mins - 60
		hours += 1
	hours = hours + seconds // 60
	if hours >= 24:
		hours = hours % 24
if hours < 10:
	print('0' + str(hours) + ':', end='')
else:
	print(str(hours) + ':', end='')
if mins < 10:
	print('0' + str(mins))
else:
	print(str(mins))


(h, m) = map(int, input().split(':'))
n = int(input())
(m, h) = ((m + n) % 60, (h + (m + n) // 60) % 24)
if h < 10:
	h = '0' + str(h)
if m < 10:
	m = '0' + str(m)
print(h, m, sep=':')


s = input()
a = int(input())
arr = s.split(':')
(hr, mini) = (int(arr[0]), int(arr[1]))
if a < 60:
	if mini + a < 60:
		l = str(mini + a)
		if len(l) == 1:
			print(arr[0] + ':' + '0' + l)
		else:
			print(arr[0] + ':' + l)
	else:
		k = (mini + a) // 60
		rem = (mini + a) % 60
		if hr == 23:
			hr = 0
			hr += k - 1
		else:
			hr += k
		hr %= 24
		h = str(hr)
		m = str(rem)
		if len(h) == 1 and len(m) == 1:
			print('0' + h + ':' + '0' + m)
		elif len(h) == 1:
			print('0' + h + ':' + m)
		elif len(m) == 1:
			print(h + ':' + '0' + m)
		else:
			print(h + ':' + m)
else:
	k = a // 60
	rem = a % 60
	if hr == 23:
		hr = 0
		hr += k - 1
	else:
		hr += k
	hr %= 24
	if rem + mini < 60:
		m = str(mini + rem)
		h = str(hr)
		if len(h) == 1 and len(m) == 1:
			print('0' + h + ':' + '0' + m)
		elif len(h) == 1:
			print('0' + h + ':' + m)
		elif len(m) == 1:
			print(h + ':' + '0' + m)
		else:
			print(h + ':' + m)
	else:
		k = (mini + rem) // 60
		rem = (mini + rem) % 60
		if hr == 23:
			hr = 0
			hr += k - 1
		else:
			hr += k
		hr %= 24
		h = str(hr)
		m = str(rem)
		if len(h) == 1 and len(m) == 1:
			print('0' + h + ':' + '0' + m)
		elif len(h) == 1:
			print('0' + h + ':' + m)
		elif len(m) == 1:
			print(h + ':' + '0' + m)
		else:
			print(h + ':' + m)


st = input()
ex = int(input())
h = int(st[:2])
m = int(st[3:])
time = h * 60 + m + ex
if time // 60 % 24 == 24:
	print('00:', end='')
elif time // 60 % 24 <= 9:
	print('0' + str(time // 60 % 24) + ':', end='')
else:
	print(str(time // 60 % 24) + ':', end='')
if time - time // 60 * 60 <= 9:
	print('0', end='')
print(str(time - time // 60 * 60))


def time_to_mins(time):
	(h, m) = map(int, time.split(':'))
	return h * 60 + m

def mins_to_time(mins):
	mins %= 24 * 60
	return str(mins // 60).zfill(2) + ':' + str(mins % 60).zfill(2)
time = input()
add_to_time = int(input())
print(mins_to_time(time_to_mins(time) + add_to_time))


def main():
	time = input()
	passed = int(input())
	time = time.split(':')
	time[0] = int(time[0])
	time[1] = int(time[1])
	hours = int(passed / 60)
	minutes = passed % 60
	time[1] = time[1] + minutes
	if time[1] > 59:
		time[1] = time[1] % 60
		time[0] = (time[0] + 1) % 24
	time[0] = (time[0] + hours) % 24
	if int(time[0] / 10) == 0:
		time[0] = '0' + str(time[0])
	if int(time[1] / 10) == 0:
		time[1] = '0' + str(time[1])
	time[0] = str(time[0])
	time[1] = str(time[1])
	print(time[0] + ':' + time[1])
main()


(hh, mm) = [int(t) for t in input().split(':')]
dm = int(input())
mm += dm
hh += mm // 60
mm %= 60
hh %= 24
print('{0}:{1}'.format(str(hh).zfill(2), str(mm).zfill(2)))


s = input().split(':')
h = int(s[0])
m = int(s[1])
n = int(input())
addH = n // 60
addM = n % 60
m += addM
if m >= 60:
	addH += m // 60
	m %= 60
h = (h + addH) % 24
if h < 10:
	h = '0' + str(h)
if m < 10:
	m = '0' + str(m)
print(h, m, sep=':')


ct = input().split(':')
ct[0] = int(ct[0])
ct[1] = int(ct[1])
mn = int(input())
hrs = int(mn / 60)
mn %= 60
ct[0] = ct[0] + hrs
ct[1] = ct[1] + mn
if ct[1] > 59:
	ct[0] += 1
ct[0] %= 24
ct[1] %= 60
if ct[0] < 10:
	ct[0] = '0{}'.format(ct[0])
if ct[1] < 10:
	ct[1] = '0{}'.format(ct[1])
print('{}:{}'.format(ct[0], ct[1]))


x = input()
v = int(input())
y = x.split(':')
var3 = int(y[0]) * 60 + int(y[1]) + v
h = var3 // 60
m = var3 % 60
if h == 24 or h == 0:
	if m < 10:
		print('00:0' + str(m))
	else:
		print('00:' + str(m))
elif h > 24:
	h = h % 24
	if m < 10 and h > 9:
		print(str(h) + ':0' + str(m))
	elif h < 10 and m < 10:
		print('0' + str(h) + ':0' + str(m))
	elif h < 10 and m >= 10:
		print('0' + str(h) + ':' + str(m))
	else:
		print(str(h) + ':' + str(m))
elif m < 10 and h > 9:
	print(str(h) + ':0' + str(m))
elif h < 10 and m < 10:
	print('0' + str(h) + ':0' + str(m))
elif h < 10 and m >= 10:
	print('0' + str(h) + ':' + str(m))
else:
	print(str(h) + ':' + str(m))


import time
(h, m) = input().split(':')
mins = int(input())
h = int(h)
m = int(m)
h += int((mins + m) / 60)
h = h % 24
m = (mins + m) % 60
if h < 10:
	print('0', h, sep='', end=':')
else:
	print(h, end=':')
if m < 10:
	print('0', m, sep='')
else:
	print(m)


(h, m) = map(int, input().split(':'))
m += int(input())
m += h * 60
m %= 24 * 60
print('{:02}:{:02}'.format(*divmod(m, 60)))


import math
arr = [int(i) for i in input().split(':')]
a = int(input())
hh = arr[0]
mm = arr[1]
minutes = hh * 60 + mm + a
ansH = math.floor(minutes / 60) % 24
ansM = minutes % 60
if ansH < 10:
	ansH = '0' + str(ansH)
if ansM < 10:
	ansM = '0' + str(ansM)
print(str(ansH) + ':' + str(ansM))


(h, m) = map(int, input().split(':'))
x = int(input())
a = (m + x) // 60
m = (m + x) % 60
h = (h + a) % 24
print('%02d:%02d' % (h, m))


l = list(map(int, input().split(':')))
minute = int(input())
ans = [0, 0]
add = 0
add += (l[1] + minute) // 60
ans[1] = (l[1] + minute) % 60
ans[0] = (add + l[0]) % 24
ans1 = ''
if ans[0] < 10:
	ans1 += '0'
ans1 += str(ans[0])
ans1 += ':'
if ans[1] < 10:
	ans1 += '0'
ans1 += str(ans[1])
print(ans1)


(h, m) = input().split(':')
h = int(h)
m = int(m)
tot = h * 60 + m
add = eval(input())
tot += add
tot %= 24 * 60
h = tot // 60
m = tot % 60
if h < 10:
	print('0' + str(h) + ':', end='')
else:
	print(str(h) + ':', end='')
if m < 10:
	print('0' + str(m))
else:
	print(str(m))


(hh, mm) = map(int, input().split(':'))
a = int(input())
dh = a // 60
dm = a % 60
hh += dh
mm += dm
if mm >= 60:
	hh += 1
hh %= 24
mm %= 60
ans = ''
if hh < 10:
	ans += '0' + str(hh)
else:
	ans += str(hh)
ans += ':'
if mm < 10:
	ans += '0' + str(mm)
else:
	ans += str(mm)
print(ans)


a = input()
c = int(input())
o = c // 60
p = c % 60
kasra = int(a[3:])
kasra += p
if kasra >= 60:
	o += kasra // 60
	kasra -= 60
	if kasra < 10:
		kasra = '0' + str(kasra)
	else:
		kasra = str(kasra)
if len(str(kasra)) == 1:
	kasra = '0' + str(kasra)
else:
	kasra = str(kasra)
z = int(a[:2])
z += o
if z >= 24:
	z -= 24 * (z // 24)
if z < 10:
	z = '0' + str(z)
z = str(z)
g = z + ':' + kasra
print(g)


a = input().split(':')
sum = int(a[0]) * 60 + int(a[1])
sum += int(input())
c = [sum // 60 % 24, sum % 60]
if c[0] < 10:
	print('0', c[0], ':', sep='', end='')
else:
	print(c[0], ':', sep='', end='')
if c[1] < 10:
	print('0', c[1], sep='')
else:
	print(c[1], sep='')


(h, m) = list(map(int, input().split(':')))
b = int(input())
print(f'{(h + (m + b) // 60) % 24:0>2}:{(m + b) % 60:0>2}')


import collections
import math
t = list(input())
a = int(input()) % 1440
m = (a % 60 + int(t[3]) * 10 + int(t[4])) % 60
h = (a // 60 + (a % 60 + int(t[3]) * 10 + int(t[4])) // 60 + int(t[1]) + int(t[0]) * 10) % 24
print(''.join((str(x) for x in [h // 10, h % 10, ':', m // 10, m % 10])))


(hh, mm) = map(int, input().split(':'))
a = int(input())
hh += a // 60
mm += a % 60
if mm >= 60:
	hh += 1
hh %= 24
mm %= 60
print('%02d:%02d' % (hh, mm))


(h, m) = map(int, input().split(':'))
t = int(input())
while t:
	t -= 1
	m += 1
	if m >= 60:
		m %= 60
		h += 1
		if h >= 24:
			h %= 24
if h < 10:
	print(0, end='')
print(h, ':', sep='', end='')
if m < 10:
	print(0, end='')
print(m)


l1 = [int(x) for x in input().split(':')]
n = int(input())
final = l1[0] * 60 + l1[1] + n
total = 24 * 60
thing = final % total
print(str(int(thing / 60)).rjust(2, '0') + str(':') + str(thing % 60).rjust(2, '0'))


import datetime

def solve(hh, mm, a):
	d0 = datetime.datetime(2016, 1, 1, hh, mm)
	d = d0 + datetime.timedelta(minutes=a)
	return d.strftime('%H:%M')
(hh, mm) = map(int, input().split(':'))
a = int(input())
print(solve(hh, mm, a))


import sys

def norm(num):
	if num < 10:
		return '0' + str(num)
	else:
		return str(num)
(h, m) = [int(x) for x in input().split(':')]
diff = int(input())
hdiff = diff // 60
mdiff = diff % 60
mans = m + mdiff
hans = (h + hdiff) % 24
hans = (hans + 1) % 24 if mans >= 60 else hans
mans %= 60
s = norm(hans) + ':' + norm(mans)
print(s)


t = list(map(int, input().split(':')))
x = t[0] * 60 + t[1] + int(input())
a = int(x / 60)
b = x % 60
if a >= 24:
	a = a % 24
if a < 10:
	a = '0' + str(a)
if b < 10:
	b = '0' + str(b)
a = str(a)
b = str(b)
s = a + ':' + b
print(s)


Cur = input()
h = int(Cur[0:2])
m = int(Cur[3:])
a = int(input())
while a:
	if a + m < 60:
		m = m + a
		a = 0
	else:
		a -= 60 - m
		m = 0
		if h == 23:
			h = 0
		else:
			h += 1
if h < 10:
	h = str(h)
	h = '0' + h
if m < 10:
	m = str(m)
	m = '0' + m
m = str(m)
h = str(h)
print(h + ':' + m)


start_time = input()
minutes = int(input())
end_time_in_minutes = (int(start_time[:2]) * 60 + int(start_time[3:]) + minutes) % (24 * 60)
ans = str(end_time_in_minutes // 60).zfill(2) + ':' + str(end_time_in_minutes % 60).zfill(2)
print(ans)


(h, m) = [int(x) for x in input().split(':')]
a = int(input())
x = (h * 60 + m + a) % (60 * 24)
h = '0' * int(x // 60 < 10) + str(x // 60)
m = '0' * int(x % 60 < 10) + str(x % 60)
print('{}:{}'.format(h, m))


(a, b) = list(map(int, input().strip().split(':')))
c = int(input())
d = b + c
a = a + d // 60
b = d % 60
a = a % 24
a = '000' + str(a)
b = '000' + str(b)
print(a[-2:] + ':' + b[-2:])


(a, b) = [int(i) for i in input().split(':')]
d = int(input())
t = (a * 60 + b + d) % (24 * 60)
print('%02d:%02d' % (t / 60, t % 60))


def display(t):
	if t < 10:
		print(end='0' + str(t))
	else:
		print(end=str(t))
time = str(input())
a = int(input())
hour = int(time[:2])
minute = int(time[3:6])
t = hour * 60 + minute + a
hour = int(t / 60) % 24
minute = t % 60
display(hour)
print(end=':')
display(minute)


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip('\n')
s = input()
hr = int(s[0:2])
mn = int(s[3:5])
t = int(input())
mn += t
add = 0
if mn >= 60:
	add = mn // 60
	mn %= 60
hr += add
if hr >= 24:
	hr %= 24
if len(str(hr)) == 2:
	print(hr, ':', sep='', end='')
	if len(str(mn)) == 2:
		print(mn)
	else:
		print(0, mn, sep='')
else:
	print(0, hr, ':', sep='', end='')
	if len(str(mn)) == 2:
		print(mn)
	else:
		print(0, mn, sep='')


def pad(s):
	return '0' * (2 - len(s)) + s
a = input()
b = int(input())
x = a.split(':')
ct = (int(x[0]) * 60 + int(x[1]) + b) % 1440
print(pad(str(ct // 60)) + ':' + pad(str(ct - ct // 60 * 60)))


s = input()
p = s.find(':')
h = int(s[:p])
m = int(s[p + 1:])
a = int(input())
m = m + 60 * h + a
m %= 1440
print('%02d:%02d' % (m // 60, m % 60))


x = input()
x = x.replace(':', ' ')
x = x.split()
y = int(input())
z = 0
while y >= 60:
	z = z + 1
	y = y - 60
a = int(x[0]) + z
b = int(x[1]) + y
c = 0
if b >= 60:
	c = c + 1
	b = b - 60
a = a + c
while a >= 24:
	a = a - 24
f = 0
while f < 10:
	if a == f:
		a = '0' + str(a)
	if b == f:
		b = '0' + str(b)
	f = f + 1
print(str(a) + ':' + str(b))


(h, m) = [int(i) for i in input().split(':')]
plus_min = int(input())
m_fin = m + plus_min
carry = m_fin // 60
m_fin = str(m_fin % 60)
h_fin = str((h + carry) % 24)
if len(h_fin) == 1:
	h_fin = '0' + h_fin
if len(m_fin) == 1:
	m_fin = '0' + m_fin
print(h_fin + ':' + m_fin)


(h, m) = map(int, input().split(':'))
a = int(input())
m2 = a % 60
m += m2
if m >= 60:
	m -= 60
	h += 1
a2 = a // 60
h = h + a2 % 24
if h >= 24:
	h -= 24
print(str(h).zfill(2) + ':' + str(m).zfill(2))


n = input()
n1 = int(n[0:2])
n2 = int(n[3:5])
k = int(input())
i = 0
for i1 in range(k):
	if i < k + 1:
		i += 1
		n2 += 1
		if n2 > 60:
			n2 = n2 % 60
			n1 += 1
		if n1 > 23:
			n1 = n1 % 24
if n2 == 60:
	n1 += 1
	n2 = 0
if n1 == 24:
	n1 = 0
if n1 < 10:
	n1 = '0' + str(n1)
if n2 < 10:
	n2 = '0' + str(n2)
print(str(n1) + ':' + str(n2))


t = list(map(int, input().split(':')))
n = int(input())
h = n // 60 + t[0]
m = n % 60 + t[1]
if m > 59:
	h += 1
(res_h, res_m) = (str(h % 24), str(m % 60))
if len(res_h) == 1:
	res_h = '0' + res_h
if len(res_m) == 1:
	res_m = '0' + res_m
print(res_h, ':', res_m, sep='')


s = input()
n = int(input())
l = s.split(':')
h = int(l[0])
m = int(l[1])
if n + m < 60:
	m = n + m
	if len(str(h)) == 1:
		h = '0' + str(h)
	if len(str(m)) == 1:
		m = '0' + str(m)
	print(str(h) + ':' + str(m))
else:
	h += (n + m) // 60
	m = (n + m) % 60
	h = h % 24
	if len(str(h)) == 1:
		h = '0' + str(h)
	if len(str(m)) == 1:
		m = '0' + str(m)
	print(str(h) + ':' + str(m))


import itertools, functools, math

def solve():
	(h, m) = map(int, input().split(':'))
	dif = int(input())
	m += h * 60 + dif
	h2 = m // 60 % 24
	m2 = m % 60
	return '{:02d}:{:02d}'.format(h2, m2)
print(solve())


import sys
import math
input = sys.stdin.readline
(h, m) = map(int, input().split(':'))
ext = int(input())
time = h * 60 + m + ext
(h, m) = (time // 60 % 24, time % 60)
if h < 10:
	h = str('0' + str(h))
if m < 10:
	m = str('0' + str(m))
print('{}:{}'.format(h, m))


t = input()
a = int(input())
x = list(map(int, t.split(':')))
n = x[0] * 60 + x[1] + a
d = n // 60
h = d % 24
m = n % 60
if m < 10:
	m = '0' + str(m)
if h < 10:
	h = '0' + str(h)
print(str(h) + ':' + str(m))


(hours, mins) = map(int, input().split(':'))
total = 60 * hours + mins
add = int(input())
total += add
total %= 60 * 24
hourOut = str(total // 60)
minOut = str(total % 60)
if len(hourOut) == 1:
	hourOut = '0' + hourOut
if len(minOut) == 1:
	minOut = '0' + minOut
print(hourOut + ':' + minOut)


(s, n) = map(int, input().split(':'))
t = int(input())
s += t // 60
n += t % 60
if n > 59:
	n = n - 60
	s += 1
if s > 23:
	s = s % 24
s = str(s).zfill(2)
n = str(n).zfill(2)
print(f'{s}:{n}')


(h, m) = map(int, input().split(':'))
a = int(input())
a %= 1440
hh = h + a // 60
mm = m + a % 60
hh = hh + mm // 60
hh %= 24
mm = mm % 60
print(('0' + str(hh) if hh < 10 else str(hh)) + ':' + ('0' + str(mm) if mm < 10 else str(mm)))


s = input().split(':')
a = int(input())
s[1] = int(s[1]) + a
x = s[1] // 60
s[0] = (int(s[0]) + x) % 24
s[1] %= 60
res = ''
if s[0] < 10:
	res += '0' + str(s[0])
	if s[1] < 10:
		res += ':0' + str(s[1])
	else:
		res += ':' + str(s[1])
else:
	res += str(s[0])
	if s[1] < 10:
		res += ':0' + str(s[1])
	else:
		res += ':' + str(s[1])
print(res)


from datetime import datetime, timedelta
print((datetime.strptime(input().strip(), '%H:%M') + timedelta(minutes=int(input().strip()))).strftime('%H:%M'))


(h, m) = map(int, input().split(':'))
n = int(input())
m += n % 60
if m >= 60:
	m -= 60
	h += 1
h += n // 60
if h >= 24:
	h %= 24
print('%02d:%02d' % (h, m))


(hh, mm) = [int(t) for t in input().split(':')]
dm = int(input())
mm += dm
hh += mm // 60
mm %= 60
hh %= 24
print('{0:02}:{1:02}'.format(hh, mm))