#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main(){
	
	int h1, m1, s1, h2, m2, s2;
	
	for(int loop = 0; loop < 3; loop++){
		
		cin >> h1 >> m1 >> s1 >> h2 >> m2 >> s2;
		
		int ans = (h2 - h1) * 3600 + (m2 - m1) * 60 + (s2 - s1);
		
		printf("%d %d %d\n", (ans / 3600), (ans / 60 % 60), (ans % 60));
		
	}
	return 0;
}