#include <iostream>

using namespace std;

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