times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60
times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60
times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60

times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60
times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60
times = map(int, raw_input().split())
passed = (times[3] - times[0]) * 3600 + (times[4] - times[1]) * 60 + times[5] - times[2]
print passed / 3600, passed % 3600 / 60, passed % 60
