#include <stdio.h>

int main(void){
	int hin, min, sin, hout, mout, sout, totalSec;
	int h,m,s;
	
	for (int i=0;i<3;i++){
		scanf("%d%d%d%d%d%d",&hin,&min,&sin,&hout,&mout,&sout);
		totalSec = (hout-hin)*3600+(mout-min)*60+(sout-sin);
		h = totalSec / 3600;
		totalSec-= h*3600;
		m = totalSec / 60;
		totalSec -= m*60;
		s = totalSec;
		printf("%d %d %d\n",h,m,s);
	}
	
	return 0;
}