#include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
  int a,b,c;
  Rep(p,3) {
    cin >> a >> b >> c;
    int sum = a * 3600 + b * 60 + c;
    cin >> a >> b >> c;
    sum = (a * 3600 + b * 60 + c) - sum;
    cout << sum / 3600 << " " << (sum % 3600) / 60 << " " << sum % 60 << endl;
  }
  return 0;
}