shijian
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, e, f;
int hour = 0, minute = 0;
int j;
cin >> a >> b >> c >> d;
j = c * 60 + d - a * 60 - b;
if(j == 0)
{
hour = 24;
minute = 0;
}
else
{
if(j < 0)
{
j+= 24 * 60;
}
hour = j / 60;
minute = j % 60;
}
cout << "O JOGO DUROU " << hour << " HORA(S) E " << minute << " MINUTO(S)";
return 0;
}