#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f;
    int A,B,C;
    while(cin>>a>>b>>c>>d>>e>>f){
        A=a*3600+b*60+c;
        B=d*3600+e*60+f;
        C=B-A;
        
        cout <<C/3600<<" "<<(C%3600)/60<<" "<<(C%3600)%60<<endl;
    }
}


