#include <cstdio>
#include <iostream>
//#include <cmath>
using namespace std;
int main()
{
int a,b,c,d,start,end,sum;
cin >> a>>b>>c>>d;
start = a *60 + b;
end =c*60+d;
sum=end-start;
if(sum<=0) sum+=1440;
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",sum/60,sum%60);
return 0;
}
都转成分钟算