a,b = map(int,input().split()) if(a<b): x = b - a elif(a==b): x = 24 else: x = 24 - a + b print("O JOGO DUROU %d HORA(S)"%x)