program Project1; {$APPTYPE CONSOLE} var t1,m1,c1,t2,m2,c2,r1,r2,r3:integer; f1,f2:text; begin assign(f1,'input.DAT'); reset(f1); readln (f1,t1,m1,c1); readln(f1,t2,m2,c2); close (f1); assign (f2, 'output.sol'); rewrite (f2); if c2>=c1 then r1:=c2-c1 else if m2=0 then begin t2:=t2-1; m2:=59; r1:=c2+60-c1; end else begin m2:=m2-1; r1:=c2+60-c1; end; if m2>=m1 then r2:=m2-m1 else begin t2:=t2-1; r2:=m2+60-m1; end; r3:=t2-t1; if r3=0 then write(f2,'00 ') else if r3<10 then write(f2,'0',r3,' ') else write(f2,r3,' '); if r2=0 then write(f2,'00 ') else if r2<10 then write(f2,'0',r2,' ') else write(f2,r2,' '); if r1=0 then write(f2,'00 ') else if r1<10 then write(f2,'0',r1) else write(f2,r1); close (f2); end.