#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    do {
      scanf("%d", &a[i]);
    } while (a[i] % 2 == 0);
  }
  int c = 0;
  int d = n - 1;
  int sum;
  for (int j = n / 2; j > 0; j--) {
    sum = a[c] - a[d];
    c++;
    d--;
    printf("%d\n", sum);
  }
  if (n % 2 == 1) {
    printf("%d", a[n / 2]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c8 <main+0xa8>
jmp    117e <main+0x5e>
mov    -0x38(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6c(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117e <main+0x5e>
jmp    11ba <main+0x9a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116d <main+0x4d>
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    1234 <main+0x114>
mov    -0x38(%rbp),%rcx
movslq -0x20(%rbp),%rax
mov    (%rcx,%rax,4),%eax
movslq -0x24(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%esi
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    11e6 <main+0xc6>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    126b <main+0x14b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r12
mov    -0x2c(%rbp),%eax
mov    %rsp,%r13
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    11f8 <main+0xd8>
xor    %r15d,%r15d
lea    0xe8f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x0(,%r15,4),%rbx
add    %r13,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
testb  $0x1,(%rbx)
je     1190 <main+0x70>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jl     1180 <main+0x60>
cmp    $0x2,%eax
jl     11f8 <main+0xd8>
mov    %r12,-0x38(%rbp)
mov    %eax,%ebx
lea    -0x4(,%rbx,4),%r14
ff
add    %r13,%r14
shr    %rbx
neg    %rbx
xor    %r15d,%r15d
mov    %r13,%r12
nop
mov    (%r12),%esi
sub    (%r14,%r15,4),%esi
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
add    $0x4,%r12
add    $0xffffffffffffffff,%r15
cmp    %r15,%rbx
jne    11d0 <main+0xb0>
mov    -0x2c(%rbp),%eax
mov    -0x38(%rbp),%r12
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
mov    %ecx,%edx
and    $0xfffffffe,%edx
sub    %edx,%eax
cmp    $0x1,%eax
jne    1221 <main+0x101>
sar    %ecx
movslq %ecx,%rax
mov    0x0(%r13,%rax,4),%esi
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
mov    %r12,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i32, i64 %5
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %31
10: ; preds = %0, %24
%11 = phi i64 [ %25, %24 ], [ 0, %0 ]
%12 = getelementptr inbounds i32, i32* %7, i64 %11
br label %19
13: ; preds = %24
%14 = icmp sgt i32 %26, 1
br i1 %14, label %15, label %31
15: ; preds = %13
%16 = lshr i32 %26, 1
%17 = zext i32 %26 to i64
%18 = zext i32 %16 to i64
br label %36
19: ; preds = %10, %19
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%21 = load i32, i32* %12
%22 = and i32 %21, 1
%23 = icmp eq i32 %22, 0
br i1 %23, label %19, label %24
24: ; preds = %19
%25 = add nuw nsw i64 %11, 1
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %10, label %13
29: ; preds = %36
%30 = load i32, i32* %1
br label %31
31: ; preds = %0, %29, %13
%32 = phi i32 [ %30, %29 ], [ %26, %13 ], [ %8, %0 ]
%33 = srem i32 %32, 2
%34 = sdiv i32 %32, 2
%35 = icmp eq i32 %33, 1
br i1 %35, label %48, label %53
36: ; preds = %15, %36
%37 = phi i64 [ 0, %15 ], [ %45, %36 ]
%38 = phi i64 [ %17, %15 ], [ %39, %36 ]
%39 = add nsw i64 %38, -1
%40 = getelementptr inbounds i32, i32* %7, i64 %37
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %7, i64 %39
%43 = load i32, i32* %42
%44 = sub nsw i32 %41, %43
%45 = add nuw nsw i64 %37, 1
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%47 = icmp eq i64 %45, %18
br i1 %47, label %29, label %36
48: ; preds = %31
%49 = sext i32 %34 to i64
%50 = getelementptr inbounds i32, i32* %7, i64 %49
%51 = load i32, i32* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %48, %31
ret i32 0
}