#include<bits/stdc++.h>
using namespace std;
int main(){
int A,B;
cin>>A>>B;
if(A==B){
printf("O JOGO DUROU 24 HORA(S)");
}
else if(B>A){
printf("O JOGO DUROU %d HORA(S)",B-A);
}
else{
printf("O JOGO DUROU %d HORA(S)",24-A+B);
}
return 0;
}