#include
using namespace std;
int h1,m1,h2,m2;```cpp
#include
using namespace std;
int h1,m1,h2,m2;
int j(int e,int f){
e=m1;
f=m2;
h1--;
m1=m1+60-m2;
}
int main(){
cin>>h1>>m1>>h2>>m2;
if(m1<m2){
j(m1,m2);
}
else{
m2=m2-m1;
}
int time=m2;
m2=m2%60;
time=m2/60;
cout<<m2<<" "<<time;
return 0;
}
int j(int e,int f){
e=m1;
f=m2;
h1--;
m1=m1+60-m2;
}
int main(){
cin>>h1>>m1>>h2>>m2;
if(m1<m2){
j(m1,m2);
}
else{
m2=m2-m1;
}
int time=m2;
m2=m2%60;
time=m2/60;
cout<<m2<<" "<<time;
return 0;
}