#!/usr/bin/env python3 import datetime def solve(h, m, offset): t0 = datetime.datetime(year=2018, month=3, day=3, hour=h, minute=m) dm0 = (offset - 9.0) * 60 dh, dm = divmod(dm0, 60) dt = datetime.timedelta(hours=dh, minutes=dm) t1 = t0 + dt return t1.hour, t1.minute def main(): a0, b0, s0 = input().split() h, m = int(a0), int(b0) offset = float(s0[3:]) h1, m1 = solve(h, m, offset) print("{:02d}:{:02d}".format(h1, m1)) if __name__ == '__main__': main()