#include <stdio.h> int main(){ int a,b,c,d; int sum1,sum2,e,h,f; scanf("%d%d%d%d",&a,&b,&c,&d); sum1=a*60+b; sum2=c*60+d; h=sum2-sum1; e=h/60; f=h%60; printf("%d %02d",e,f); return 0; }