casovi = int(input()) minuti = int(input()) casovi = (casovi + 12 - 1) % 12 + 1 print(f"{casovi}:{minuti}")