#include<iostream>

using namespace std;

int main() {
	int h, m, s;
	int sec[2], ans;
	for(int i=0; i<3; ++i) {
		for(int j=0; j<2; ++j) {
			cin >> h >> m >> s;
			sec[j] = h*3600 + m*60 + s;
		}
		ans = sec[1] - sec[0];
		cout << ans/3600 << " " << (ans/60)%60 << " " << (ans%60) << endl;
	}
	return 0;
}