
#include <iostream>
using namespace std;

int main() {

	for(int i = 0; i < 3; i++){
		int hour,min,sec;
		cin >> hour >> min >> sec;
		int byoin = hour * 60 * 60 + min*60 + sec;
		cin >> hour >> min >> sec;
		int byoout = hour * 60*60 + min*60 + sec;
		int zaisya = byoout - byoin;
		cout << zaisya / (60*60) << " " << zaisya % (60*60) / 60 << " " << zaisya % 60 << endl;
	}

	return 0;
}