#include <cstdio>
using namespace std;
int main(void){
  int h,m,s;
  int h1,m1,s1,h2,m2,s2;
  while(~scanf("%d %d %d %d %d %d",&h1,&m1,&s1,&h2,&m2,&s2)){
    s=(s2+m2*60+h2*3600)-(s1+m1*60+h1*3600);
    h=s/3600;m=s%3600/60;s=s%60;
    printf("%d %d %d\n",h,m,s);
  }
  return 0;
}