#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 = 0, j = 0;
  scanf("%d", &n);
  int res = 0;
  int arr[n];
  while (i < n) {
    scanf("%d", &arr[i]);
    if (arr[i] % 2)
      i++;
  }
  i = n - 1;
  while (j < i) {
    res = arr[j] - arr[i];
    printf("%d\n", res);
    j++;
    i--;
  }
  if (i == j)
    printf("%d\n", arr[j]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
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,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cc <main+0xac>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe63(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c7 <main+0xa7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <main+0x5b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121c <main+0xfc>
mov    -0x30(%rbp),%rcx
movslq -0x10(%rbp),%rax
mov    (%rcx,%rax,4),%eax
movslq -0xc(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11d5 <main+0xb5>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    123f <main+0x11f>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
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
sub    $0x18,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1206 <main+0xe6>
mov    %r14,-0x38(%rbp)
xor    %ebx,%ebx
lea    0xe8d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%r14d
lea    (%r12,%r14,4),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
mov    (%r12,%r14,4),%eax
and    $0x1,%eax
add    %eax,%ebx
mov    -0x2c(%rbp),%r13d
cmp    %r13d,%ebx
jl     1180 <main+0x60>
cmp    $0x2,%r13d
jl     11e6 <main+0xc6>
lea    -0x1(%r13),%r14
xor    %ebx,%ebx
lea    0xe4f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r12,%rbx,4),%esi
sub    (%r12,%r14,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
cmp    %r14,%rbx
jl     11c0 <main+0xa0>
mov    %ebx,%eax
not    %eax
add    %r13d,%eax
jmp    11ec <main+0xcc>
lea    -0x1(%r13),%eax
xor    %ebx,%ebx
cmp    %ebx,%eax
mov    -0x38(%rbp),%r14
jne    1206 <main+0xe6>
mov    %ebx,%eax
mov    (%r12,%rax,4),%esi
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
mov    %r14,%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
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %5
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i32, i64 %10
store i64 %10, i64* %7
br label %13
13: ; preds = %31, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %32
17: ; preds = %13
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %12, i64 %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %12, i64 %23
%25 = load i32, i32* %24
%26 = srem i32 %25, 2
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %17
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %31
31: ; preds = %28, %17
br label %13
32: ; preds = %13
%33 = load i32, i32* %2
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %3
br label %35
35: ; preds = %39, %32
%36 = load i32, i32* %4
%37 = load i32, i32* %3
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %55
39: ; preds = %35
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %12, i64 %41
%43 = load i32, i32* %42
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %12, i64 %45
%47 = load i32, i32* %46
%48 = sub nsw i32 %43, %47
store i32 %48, i32* %5
%49 = load i32, i32* %5
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
%53 = load i32, i32* %3
%54 = add nsw i32 %53, -1
store i32 %54, i32* %3
br label %35
55: ; preds = %35
%56 = load i32, i32* %3
%57 = load i32, i32* %4
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = load i32, i32* %4
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %12, i64 %61
%63 = load i32, i32* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %59, %55
%66 = load i8*, i8** %6
%67 = load i32, i32* %1
ret i32 %67
}

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