#include <bits/stdc++.h>

using namespace std;

int InputTime() {
	int h, m, s; cin >> h >> m >> s;
	return (h * 60 + m) * 60 + s;
}
void OutputTime(int sec) {
	int min = sec / 60; sec %= 60;
	int hour = min / 60; min %= 60;
	cout << hour << " " << min << " " << sec << endl;
}

int main() {
	for (int i = 0; i < 3; ++i) {
		int t1 = InputTime();
		int t2 = InputTime();
		OutputTime(t2 - t1);
	}
}