#include <bits/stdc++.h>
using namespace std;

int main(){
	int h,m,s,tss,tse,tsr;
	for(int i=0;i<3;i++){
		cin>>h>>m>>s;
		tss=3600*h+60*m+s;
		cin>>h>>m>>s;
		tse=3600*h+60*m+s;
		tsr=tse-tss;
		cout<<tsr/3600<<" "<<tsr/60%60<<" "<<tsr%60<<endl;
	}
	return 0;
}
