import std.stdio;
import std.range;
//arrival, leaving
void showTime(int t){
	int h = t / 3600, m = t % 3600 / 60, s = t % 3600 % 60;
	writefln("%d %d %d", h, m, s);
}

void main(){
	int[] kt;
	for(int i=3;i;i--){
		int ah, am, as, lh, lm, ls;
		readf("%d %d %d %d %d %d\n", &ah, &am, &as, &lh, &lm, &ls);
		kt ~= (lh-ah) * 3600 + (lm-am) * 60 + (ls-as);
	}
	while(!kt.empty())
		showTime(kt.front), kt.popFront();
}