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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d3 <main+0xb3>
mov    -0x28(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6a(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c0 <main+0xa0>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11c5 <main+0xa5>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <main+0x54>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    122c <main+0x10c>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
sub    (%rax,%rcx,4),%esi
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11da <main+0xba>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1266 <main+0x146>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%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),%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
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    11e3 <main+0xc3>
xor    %ebx,%ebx
lea    0xe93(%rip),%r15
nopl   (%rax)
mov    %ebx,%r13d
lea    (%r12,%r13,4),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
mov    (%r12,%r13,4),%eax
and    $0x1,%eax
add    %eax,%ebx
mov    -0x2c(%rbp),%eax
cmp    %eax,%ebx
jl     1170 <main+0x50>
cmp    $0x2,%eax
jl     11ed <main+0xcd>
mov    $0xffffffff,%r13d
xor    %ebx,%ebx
lea    0xe60(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r12,%rbx,4),%esi
add    %r13d,%eax
cltq
sub    (%r12,%rax,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rdx
add    $0xffffffff,%r13d
cmp    %rdx,%rbx
jl     11b0 <main+0x90>
jmp    11f6 <main+0xd6>
mov    %eax,%ecx
neg    %ecx
shr    %ecx
neg    %ecx
jmp    11f6 <main+0xd6>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
and    $0xfffffffe,%edx
sub    %edx,%eax
cmp    $0x1,%eax
jne    121b <main+0xfb>
movslq %ecx,%rax
mov    0x4(%r12,%rax,4),%esi
lea    0xdea(%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 i8*
%5 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i32, i64 %8
store i64 %8, i64* %5
store i32 0, i32* %3
br label %11
11: ; preds = %30, %0
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %33
15: ; preds = %11
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %10, 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* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %10, i64 %21
%23 = load i32, i32* %22
%24 = srem i32 %23, 2
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %15
%27 = load i32, i32* %3
%28 = add nsw i32 %27, -1
store i32 %28, i32* %3
br label %29
29: ; preds = %26, %15
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %11
33: ; preds = %11
store i32 0, i32* %3
br label %34
34: ; preds = %53, %33
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = sdiv i32 %36, 2
%38 = icmp slt i32 %35, %37
br i1 %38, label %39, label %56
39: ; preds = %34
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %10, i64 %41
%43 = load i32, i32* %42
%44 = load i32, i32* %2
%45 = sub nsw i32 %44, 1
%46 = load i32, i32* %3
%47 = sub nsw i32 %45, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %10, i64 %48
%50 = load i32, i32* %49
%51 = sub nsw i32 %43, %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 = %39
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %34
56: ; preds = %34
%57 = load i32, i32* %2
%58 = srem i32 %57, 2
%59 = icmp eq i32 %58, 1
br i1 %59, label %60, label %68
60: ; preds = %56
%61 = load i32, i32* %2
%62 = sdiv i32 %61, 2
%63 = add nsw i32 %62, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %10, i64 %64
%66 = load i32, i32* %65
%67 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %60, %56
store i32 0, i32* %1
%69 = load i8*, i8** %4
%70 = load i32, i32* %1
ret i32 %70
}

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