#include <iostream>
using namespace std;

int main(){
  int h,m,s,h1,m1,s1;
  for(int i=0;i<3;i++){
    cin >> h >> m >> s >> h1 >> m1 >> s1;
    int sum,sum1;
    sum = h*3600 + m*60 + s;
    sum1 = h1*3600 + m1*60 + s1;
    sum = sum1 - sum;
    h = sum / 3600;
    sum %= 3600;
    m = sum / 60;
    sum %= 60;
    cout << h << " " << m << " " << sum << endl;
  }
}