#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, i, sum, w;
  scanf("%d", &n);
  int arr[n];
  i = 0;
  do {
    do {
      scanf("%d", &arr[i]);
    } while (arr[i] % 2 == 0);
    i++;
  } while (i < n);
  i = 0;
  w = n - 1;
  do {
    sum = arr[i] - arr[w];
    printf("%d\n", sum);
    i++;
    w--;
  } while (i < n / 2);
  if (n % 2 != 0) {
    printf("%d", arr[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,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1172 <main+0x52>
mov    -0x38(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe78(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1172 <main+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     116d <main+0x4d>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x38(%rbp),%rcx
movslq -0xc(%rbp),%rax
mov    (%rcx,%rax,4),%eax
movslq -0x14(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jl     11ce <main+0xae>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     126c <main+0x14c>
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    0xdac(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x2c(%rbp)
jmp    1273 <main+0x153>
movl   $0x0,-0x2c(%rbp)
mov    -0x20(%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
push   %rax
lea    0xecb(%rip),%r14
lea    -0x2c(%rbp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
xor    %r13d,%r13d
nop
lea    (%r12,%r13,4),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
testb  $0x1,(%rbx)
je     1170 <main+0x50>
add    $0x1,%r13
movslq -0x2c(%rbp),%rbx
cmp    %rbx,%r13
jl     1160 <main+0x40>
add    $0xffffffffffffffff,%rbx
xor    %r13d,%r13d
lea    0xe68(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r12,%r13,4),%esi
sub    (%r12,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%r13
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rcx
add    $0xffffffffffffffff,%rbx
cmp    %rcx,%r13
jl     11a0 <main+0x80>
test   $0x1,%al
je     11e0 <main+0xc0>
mov    (%r12,%rcx,4),%esi
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%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 i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %6
%13 = alloca i32, i64 %11
store i64 %11, i64* %7
store i32 0, i32* %3
br label %14
14: ; preds = %30, %0
br label %15
15: ; preds = %20, %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %13, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %13, i64 %22
%24 = load i32, i32* %23
%25 = srem i32 %24, 2
%26 = icmp eq i32 %25, 0
br i1 %26, label %15, label %27
27: ; preds = %20
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
br i1 %33, label %14, label %34
34: ; preds = %30
store i32 0, i32* %3
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %5
br label %37
37: ; preds = %53, %34
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %13, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %13, i64 %43
%45 = load i32, i32* %44
%46 = sub nsw i32 %41, %45
store i32 %46, i32* %4
%47 = load i32, i32* %4
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
%51 = load i32, i32* %5
%52 = add nsw i32 %51, -1
store i32 %52, i32* %5
br label %53
53: ; preds = %37
%54 = load i32, i32* %3
%55 = load i32, i32* %2
%56 = sdiv i32 %55, 2
%57 = icmp slt i32 %54, %56
br i1 %57, label %37, label %58
58: ; preds = %53
%59 = load i32, i32* %2
%60 = srem i32 %59, 2
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %69
62: ; preds = %58
%63 = load i32, i32* %2
%64 = sdiv i32 %63, 2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %13, i64 %65
%67 = load i32, i32* %66
%68 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %67)
store i32 0, i32* %1
store i32 1, i32* %8
br label %70
69: ; preds = %58
store i32 0, i32* %8
br label %70
70: ; preds = %69, %62
%71 = load i8*, i8** %6
%72 = load i32, i32* %8
switch i32 %72, label %75 [
i32 0, label %73
i32 1, label %73
]
73: ; preds = %70, %70
%74 = load i32, i32* %1
ret i32 %74
75: ; preds = %70
unreachable
}

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
br label %8
8: ; preds = %16, %0
%9 = phi i64 [ %17, %16 ], [ 0, %0 ]
%10 = getelementptr inbounds i32, i32* %7, i64 %9
br label %11
11: ; preds = %11, %8
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%13 = load i32, i32* %10
%14 = and i32 %13, 1
%15 = icmp eq i32 %14, 0
br i1 %15, label %11, label %16
16: ; preds = %11
%17 = add nuw nsw i64 %9, 1
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %8, label %21
21: ; preds = %16
%22 = sext i32 %18 to i64
br label %23
23: ; preds = %21, %23
%24 = phi i64 [ 0, %21 ], [ %33, %23 ]
%25 = phi i64 [ %22, %21 ], [ %26, %23 ]
%26 = add nsw i64 %25, -1
%27 = getelementptr inbounds i32, i32* %7, i64 %24
%28 = load i32, i32* %27
%29 = getelementptr inbounds i32, i32* %7, i64 %26
%30 = load i32, i32* %29
%31 = sub nsw i32 %28, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = add nuw nsw i64 %24, 1
%34 = load i32, i32* %1
%35 = sdiv i32 %34, 2
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %33, %36
br i1 %37, label %23, label %38
38: ; preds = %23
%39 = and i32 %34, 1
%40 = icmp eq i32 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %38
%42 = getelementptr inbounds i32, i32* %7, i64 %36
%43 = load i32, i32* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %38, %41
ret i32 0
}