#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
int hours,minutes;
cin>>a>>b>>c>>d;
if (c<a)
{
hours = 24-a +c;
}
else if (c==a && b>=d)
{
hours = 24;
}
else
{
hours = c-a;
}
if (d<b)
{
hours -=1;
minutes = 60-b +d;
}
else
{
minutes = d - b;
}
printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",hours,minutes);
return 0;
}