#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *);
int main(void) {
  int hin, min, sin, hout, mout, sout, i, time;
  for (i = 0; i < 3; i++) {
    scanf("%d%d%d%d%d%d", &hin, &min, &sin, &hout, &mout, &sout);
    time = (hout - hin) * 3600 + (mout - min) * 60 + (sout - sin);
    printf("%d %d %d\n", time / 3600, (time % 3600) / 60, (time % 3600) % 60);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11e3 <main+0xc3>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
lea    -0x1c(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   $0xe10,%eax,%eax
mov    -0x18(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   $0x3c,%ecx,%ecx
add    %ecx,%eax
mov    -0x1c(%rbp),%ecx
sub    -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x24(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x28(%rbp),%edx
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
lea    0xec2(%rip),%r15
lea    0x24(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x1c(%rsp),%rbp
lea    0x14(%rsp),%r8
lea    0x18(%rsp),%r14
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r14,%r9
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
sub    0x24(%rsp),%eax
imul   $0xe10,%eax,%eax
mov    0x18(%rsp),%ecx
sub    0x20(%rsp),%ecx
imul   $0x3c,%ecx,%ecx
mov    0x10(%rsp),%edx
sub    0x1c(%rsp),%edx
add    %eax,%ecx
add    %ecx,%edx
movslq %edx,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
lea    0xe2d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
lea    0x14(%rsp),%r8
mov    %r14,%r9
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
sub    0x24(%rsp),%eax
imul   $0xe10,%eax,%eax
mov    0x18(%rsp),%ecx
sub    0x20(%rsp),%ecx
imul   $0x3c,%ecx,%ecx
mov    0x10(%rsp),%edx
sub    0x1c(%rsp),%edx
add    %eax,%ecx
add    %ecx,%edx
movslq %edx,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
lea    0x14(%rsp),%r8
mov    %r14,%r9
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
sub    0x24(%rsp),%eax
imul   $0xe10,%eax,%eax
mov    0x18(%rsp),%ecx
sub    0x20(%rsp),%ecx
imul   $0x3c,%ecx,%ecx
mov    0x10(%rsp),%edx
sub    0x1c(%rsp),%edx
add    %eax,%ecx
add    %ecx,%edx
movslq %edx,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xe10,%esi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%edx
imul   $0x3c,%edi,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d%d%d%d%d%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %8
br label %10
10: ; preds = %37, %0
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %40
13: ; preds = %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = sub nsw i32 %15, %16
%18 = mul nsw i32 %17, 3600
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %21, 60
%23 = add nsw i32 %18, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
%27 = add nsw i32 %23, %26
store i32 %27, i32* %9
%28 = load i32, i32* %9
%29 = sdiv i32 %28, 3600
%30 = load i32, i32* %9
%31 = srem i32 %30, 3600
%32 = sdiv i32 %31, 60
%33 = load i32, i32* %9
%34 = srem i32 %33, 3600
%35 = srem i32 %34, 60
%36 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %32, i32 %35)
br label %37
37: ; preds = %13
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %10
40: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d%d%d%d%d%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%14 = load i32, i32* %4
%15 = load i32, i32* %1
%16 = sub nsw i32 %14, %15
%17 = mul nsw i32 %16, 3600
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = sub nsw i32 %18, %19
%21 = mul nsw i32 %20, 60
%22 = add nsw i32 %21, %17
%23 = load i32, i32* %6
%24 = load i32, i32* %3
%25 = sub nsw i32 %23, %24
%26 = add nsw i32 %22, %25
%27 = sdiv i32 %26, 3600
%28 = srem i32 %26, 3600
%29 = trunc i32 %28 to i16
%30 = sdiv i16 %29, 60
%31 = sext i16 %30 to i32
%32 = srem i16 %29, 60
%33 = sext i16 %32 to i32
%34 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %31, i32 %33)
%35 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%36 = load i32, i32* %4
%37 = load i32, i32* %1
%38 = sub nsw i32 %36, %37
%39 = mul nsw i32 %38, 3600
%40 = load i32, i32* %5
%41 = load i32, i32* %2
%42 = sub nsw i32 %40, %41
%43 = mul nsw i32 %42, 60
%44 = add nsw i32 %43, %39
%45 = load i32, i32* %6
%46 = load i32, i32* %3
%47 = sub nsw i32 %45, %46
%48 = add nsw i32 %44, %47
%49 = sdiv i32 %48, 3600
%50 = srem i32 %48, 3600
%51 = trunc i32 %50 to i16
%52 = sdiv i16 %51, 60
%53 = sext i16 %52 to i32
%54 = srem i16 %51, 60
%55 = sext i16 %54 to i32
%56 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %49, i32 %53, i32 %55)
%57 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%58 = load i32, i32* %4
%59 = load i32, i32* %1
%60 = sub nsw i32 %58, %59
%61 = mul nsw i32 %60, 3600
%62 = load i32, i32* %5
%63 = load i32, i32* %2
%64 = sub nsw i32 %62, %63
%65 = mul nsw i32 %64, 60
%66 = add nsw i32 %65, %61
%67 = load i32, i32* %6
%68 = load i32, i32* %3
%69 = sub nsw i32 %67, %68
%70 = add nsw i32 %66, %69
%71 = sdiv i32 %70, 3600
%72 = srem i32 %70, 3600
%73 = trunc i32 %72 to i16
%74 = sdiv i16 %73, 60
%75 = sext i16 %74 to i32
%76 = srem i16 %73, 60
%77 = sext i16 %76 to i32
%78 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %71, i32 %75, i32 %77)
ret i32 0
}