#include <iostream>
using namespace std;
int main(){
	int h, m, s,hh,mm,ss,sum;
	for (int i = 0; i < 3; i++){
		cin >> h >> m >> s >> hh >> mm >> ss;
		sum = hh * 3600 + mm * 60 + ss;
		sum -= h * 3600 + m * 60 + s;
		cout << sum / 3600 << " " << sum % 3600 / 60  << " "<< sum % 3600 % 60 << endl;
	}
}