#include <cstdio>
int main() {
	int h1,h2,m1,m2,s1,s2;
	for(int i=0;i<3;i++) {
		scanf("%d %d %d %d %d %d",&h1,&m1,&s1,&h2,&m2,&s2);
		int tm1=h1*3600+m1*60+s1;
		int tm2=h2*3600+m2*60+s2;
		int tm3=tm2-tm1;
		printf("%d %d %d\n",tm3/3600,tm3/60%60,tm3%60);
	}
}