#include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d
int s = a*60+b;
int e = c*60+d;
cout<<h<<" "<<m
int p = e-s;
int h = p/60;
int m = p - h*60;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d
int s = a*60+b;
int e = c*60+d;
cout<<h<<" "<<m
int p = e-s;
int h = p/60;
int m = p - h*60;
return 0;
}