#include <cstdio>
int main() {
	int h,m,s,t;
	for(int i=0;i<3;i++) {
		scanf("%d %d %d",&h,&m,&s);
		t=h*3600+m*60+s;
		scanf("%d %d %d",&h,&m,&s);
		t=h*3600+m*60+s-t;
		printf("%d %d %d\n",t/3600,t%3600/60,t%60);
	}
}