#include<stdio.h>

int main(void){
	int s,i,j,tmp,ans;
	int t[]={3600,60,1};
	for(i=0;i<3;i++){
		tmp=ans=0;
		for(j=0;j<6;j++){
			scanf("%d",&s);
			if(j<3)tmp+=s*t[j];
			else ans+=s*t[j-3];
		}
		ans-=tmp;
		int h,m;
		h=ans/3600;
		ans=ans%3600;
		m=ans/60;
		printf("%d %d %d\n",h,m,ans%60);
		
	}
	return 0;
}