#include<iostream> using namespace std; int main() { int a , b , c , d = 0; cin>>a>>b>>c>>d; int E = (c*60+d) - (a*60+b); if(E >= 60) { cout<<c-a<<" "<<E % 60; } else { cout<<"0 "<< E; } }