#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 q;
  scanf("%d", &q);
  int p[q], k, l = 1;
  k = 0;
  do {
    scanf("%d", &p[k]);
    if (p[k] % 2 != 0) {
      k++;
    }
  } while (k < q);
  k = 0;
  while (k < q / 2) {
    printf("%d\n", p[k] - p[q - l]);
    k++;
    l++;
  }
  if (q % 2 != 0) {
    printf("%d\n", p[q / 2]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe76(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b4 <main+0x94>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b9 <main+0x99>
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1174 <main+0x54>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%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    1224 <main+0x104>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%ecx
sub    -0x20(%rbp),%ecx
movslq %ecx,%rcx
sub    (%rax,%rcx,4),%esi
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11cc <main+0xac>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     125b <main+0x13b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdad(%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
push   %rax
lea    0xecb(%rip),%r15
lea    -0x2c(%rbp),%rsi
mov    %r15,%rdi
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
xor    %ebx,%ebx
xchg   %ax,%ax
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     1160 <main+0x40>
cmp    $0x2,%eax
jl     11fc <main+0xdc>
mov    $0xffffffffffffffff,%r13
xor    %ebx,%ebx
lea    0xe6f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r12,%rbx,4),%esi
cltq
add    %r13,%rax
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    $0xffffffffffffffff,%r13
cmp    %rdx,%rbx
jl     11a0 <main+0x80>
test   $0x1,%al
je     11e8 <main+0xc8>
movslq %ecx,%rax
mov    (%r12,%rax,4),%esi
lea    0xe20(%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
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
test   $0x1,%al
jne    11d5 <main+0xb5>
jmp    11e8 <main+0xc8>

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