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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7e4(%rbp)
lea    0xebd(%rip),%rdi
lea    -0x7e8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x7e4(%rbp),%eax
cmp    -0x7e8(%rbp),%eax
jge    11b5 <main+0x95>
movslq -0x7e4(%rbp),%rax
lea    -0x7e0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe83(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x7e4(%rbp),%rax
mov    -0x7e0(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b0 <main+0x90>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    114f <main+0x2f>
movl   $0x0,-0x7e4(%rbp)
mov    -0x7e4(%rbp),%eax
mov    %eax,-0x7ec(%rbp)
mov    -0x7e8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x7ec(%rbp),%eax
cmp    %ecx,%eax
jge    122f <main+0x10f>
movslq -0x7e4(%rbp),%rax
mov    -0x7e0(%rbp,%rax,4),%esi
mov    -0x7e8(%rbp),%eax
sub    $0x1,%eax
sub    -0x7e4(%rbp),%eax
cltq
sub    -0x7e0(%rbp,%rax,4),%esi
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    11bf <main+0x9f>
mov    -0x7e8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1269 <main+0x149>
mov    -0x7e8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
mov    -0x7e0(%rbp,%rax,4),%esi
lea    0xd9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11c2 <main+0xa2>
xor    %ebp,%ebp
lea    0xeb3(%rip),%r14
nopl   (%rax)
mov    %ebp,%ebx
lea    (%rsp,%rbx,4),%rsi
add    $0x10,%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp,%rbx,4),%eax
and    $0x1,%eax
add    %eax,%ebp
mov    0xc(%rsp),%eax
cmp    %eax,%ebp
jl     1150 <main+0x30>
cmp    $0x2,%eax
jl     11ef <main+0xcf>
mov    $0xffffffff,%ebp
xor    %ebx,%ebx
lea    0xe7d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
add    %ebp,%eax
cltq
sub    0x10(%rsp,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rdx
add    $0xffffffff,%ebp
cmp    %rdx,%rbx
jl     1190 <main+0x70>
jmp    11ca <main+0xaa>
mov    %eax,%ecx
neg    %ecx
shr    %ecx
neg    %ecx
test   $0x1,%al
je     11e1 <main+0xc1>
movslq %ecx,%rax
mov    0x10(%rsp,%rax,4),%esi
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
test   $0x1,%al
jne    11ce <main+0xae>
jmp    11e1 <main+0xc1>

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 [500 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %6
6: ; preds = %24, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = srem i32 %18, 2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %10
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %10
br label %6
25: ; preds = %6
store i32 0, i32* %3
br label %26
26: ; preds = %31, %25
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = sdiv i32 %28, 2
%30 = icmp slt i32 %27, %29
br i1 %30, label %31, label %47
31: ; preds = %26
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 1
%38 = load i32, i32* %3
%39 = sub nsw i32 %37, %38
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = sub nsw i32 %35, %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %26
47: ; preds = %26
%48 = load i32, i32* %4
%49 = srem i32 %48, 2
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %47
%52 = load i32, i32* %4
%53 = sdiv i32 %52, 2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [500 x i32], [500 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %51, %47
ret i32 0
}

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