#include <stdio.h>
#include <iostream>
#define INF 100000000
using namespace std;
typedef pair<int,int> P;
int main()
{
	for(int i=0;i<3;i++){
		int h,m,s,h2,m2,s2;cin>>h>>m>>s>>h2>>m2>>s2;
		int as=3600*(h2-h)+60*(m2-m)+(s2-s);
		int ah=as/3600;as-=ah*3600;
		int am=as/60;as-=am*60;
		printf("%d %d %d\n",ah,am,as);
	}
}