https://www.luogu.com.cn/problem/P5707
"""
P5707 【深基2.例12】上学迟到
https://www.luogu.com.cn/problem/P5707
"""
import math
s,v=map(int,input().split())
n=8*60+24*60
t=math.ceil(s/v)+10
n=n-t
if n>=24*60:
n-=24*60
b=n%60
a=n//60
if a<10:
if b<10:
print("0%d"%a,end=":0")
print(b)
else:
print("0%d"%a,end=":")
print(b)
else:
if b<10:
print(a,end=":0")
print(b)
else:
print(a,end=":")
print(b)