N=int(input()) A=(10+N//100)%24 B=N%100//10*6 C=':0' if B>9:C=':' print(str(A)+C+str(B))