#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main() {
	for(int i = 0; i < 3; i++) {
		cin >> a >> b >> c;
		int p = a * 3600 + b * 60 + c;
		cin >> a >> b >> c;
		int q = a * 3600 + b * 60 + c;
		int r = q - p;
		cout << r / 3600 << ' ' << r / 60 % 60 << ' ' << r % 60 << endl;
	}
	return 0;
}