#include<stdio.h>
int main(void)
{
	int a,s,d,f,g,h,j,z,x,c,v,b,n,i;
	for(i=1;i<=3;i++){
		scanf("%d %d %d %d %d %d ",&a,&s,&d,&f,&g,&h);
		j=d+s*60+a*3600;
		z=h+g*60+f*3600;
		x=z-j;
		c=x/60;
		v=x%60;
		b=c/60;
		n=c%60;
		printf("%d %d %d\n",b,n,v);
	}
	return 0;
}