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