#include <iostream>
int main()
{
	int h1,h2,m1,m2,s1,s2;
	while(std::cin>>h1>>m1>>s1>>h2>>m2>>s2){
		int sum = (h2*3600+m2*60+s2)-(h1*3600+m1*60+s1);
		printf("%d %d %d\n",sum/3600,(sum%3600)/60,sum%60);
	}
	return 0;
}