a = int(input()) b = int(a//100) c = int((a-100*b)//10) b = (b+10)%24 c = c*6 if b<10 and c<10: print("0",b,":","0",c,sep="") elif b<10: print("0",b,":",c,sep="") elif c<10: print(b,":","0",c,sep="") else: print(b,c,sep=":")