从小时到分钟开始算游戏时间
//AcWing 668 游戏时间2
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int A,B,C,D;
int x,y;
int main(){
cin >> A >> B >> C >> D;
if(A > C) x = C + 24 - A;
else if(A == C && B >= D) x = 24;
else x = C - A;
if(B > D){
x -= 1;
y = 60 + D - B;
}else
y = D - B;
cout << "O JOGO DUROU " << x << " HORA(S) E " << y << " MINUTO(S) " << endl;
return 0;
}