x,y=map(int,input().split())
if y<30:
y+=30
x+=2
if x>=24:
x-=24
print("0",x,":",y,sep="")
else:
print(x,":",y,sep="")
elif y==30:
x+=3
if x>=24:
x-=24
print("0",x,":","00",sep="")
else:
print(x,":",y,sep="")
else:
if y+30>=60:
x+=3
y-=30
if x>=24:
x-=24
print("0",x,":",y,sep="")
else:
print(x,":",y,sep="")