#include<iostream>
using namespace std;
int main(){
int a,b,c,d,start,end,x,y;
cin>>a>>b>>c>>d;
start=a*60+b;//以零点为起点总共多少分钟
end=c*60+d;
if((a>c)||(a==c&&b>d))// 通宵了
{
end+=24*60;
}
int spend_time=end-start;
x=spend_time/60;
y=spend_time%60;
if(spend_time==0)
{
x=24;
y=0;//不可能时长为0
}
cout<<"O JOGO DUROU "<<x<<" HORA(S) E "<<y<<" MINUTO(S)";
return 0;
}
04-16
1724
07-24
169
05-03
4427
08-19
2218
03-05
3993
09-09
365
09-05
1182