#!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools import bisect import heapq def input(): return sys.stdin.readline()[:-1] # sys.setrecursionlimit(1000000) # _INPUT = """22 20 UTC+8 # """ # sys.stdin = io.StringIO(_INPUT) a, b, S = input().split() m = int(a) * 60 + int(b) dm = int((float(S[3:])-9) * 10) * 6 m1 = (m + dm) % (60 * 24) print(f'{m1//60:02}:{m1%60:02}')